pl.edu.agh.cast.importer.wizard.template
Class TemplatesManagementComposite

java.lang.Object
  extended by org.eclipse.swt.widgets.Widget
      extended by org.eclipse.swt.widgets.Control
          extended by org.eclipse.swt.widgets.Scrollable
              extended by org.eclipse.swt.widgets.Composite
                  extended by pl.edu.agh.cast.importer.wizard.template.TemplatesManagementComposite
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable, ITemplateManagementView, ITemplateSelectionListener

public class TemplatesManagementComposite
extends org.eclipse.swt.widgets.Composite
implements ITemplateManagementView, ITemplateSelectionListener

Default implementation of ITemplateManagementView.

Author:
AGH CAST Team

Field Summary
 
Fields inherited from class org.eclipse.swt.widgets.Composite
embeddedHandle
 
Fields inherited from class org.eclipse.swt.widgets.Widget
handle
 
Constructor Summary
TemplatesManagementComposite(org.eclipse.swt.widgets.Composite parent, int style)
          The default constructor.
 
Method Summary
 void addTemplateSelecionListener(ITemplateSelectionListener listener)
          Adds template selection listener.
 void dispose()
          
 void initialize(TemplateManagementPresenter templatePresenter)
          Initializes the view with presenter.
static void main(String[] args)
          Auto-generated main method to display this org.eclipse.swt.widgets.Composite inside a new Shell.
 void removeTemplateSelectionListener(ITemplateSelectionListener listener)
          Removes template selection listener.
 void selectionChanged(IImportTemplate selected)
          Notifies about template selection change.
 void setEnabled(boolean enabled)
          
 void setInput(Collection<TemplateGroupTreeEntry> groups)
          Sets list of import template groups as an input.
 void showCannotRemoveTemplateError(IImportTemplate template, TemplateException e)
          Notifies user that an error occurred removing a given template.
static void showGUI()
          Auto-generated method to display this org.eclipse.swt.widgets.Composite inside a new Shell.
 void showNoTemplateSelectedInfo()
          Notifies user that no template is selected while trying to remove one.
 int showRemoveTemplateConfirmationQuestion(IImportTemplate template)
          Asks user if he/she wants to remove a given template.
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, computeSize, getBackgroundMode, getChildren, getClientArea, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getBorderWidth, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addDragDetectListener, addFocusListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getRegion, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setRegion, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TemplatesManagementComposite

public TemplatesManagementComposite(org.eclipse.swt.widgets.Composite parent,
                                    int style)
The default constructor.

Parameters:
parent - parent composite
style - STW style
Method Detail

main

public static void main(String[] args)
Auto-generated main method to display this org.eclipse.swt.widgets.Composite inside a new Shell.


showGUI

public static void showGUI()
Auto-generated method to display this org.eclipse.swt.widgets.Composite inside a new Shell.


addTemplateSelecionListener

public void addTemplateSelecionListener(ITemplateSelectionListener listener)
Adds template selection listener.

Specified by:
addTemplateSelecionListener in interface ITemplateManagementView
Parameters:
listener - the template selection listener

removeTemplateSelectionListener

public void removeTemplateSelectionListener(ITemplateSelectionListener listener)
Removes template selection listener.

Specified by:
removeTemplateSelectionListener in interface ITemplateManagementView
Parameters:
listener - the template selection listener
See Also:
#removeTemplateSelectionListener(pl.edu.agh.cast.importer.wizard.template.ITemplateSelectionListener)

setEnabled

public void setEnabled(boolean enabled)

Overrides:
setEnabled in class org.eclipse.swt.widgets.Control
See Also:
Control.setEnabled(boolean)

setInput

public void setInput(Collection<TemplateGroupTreeEntry> groups)
Sets list of import template groups as an input.

Specified by:
setInput in interface ITemplateManagementView
Parameters:
groups - collection of template groups
See Also:
pl.edu.agh.cast.importer.wizard.template.ITemplateManagementView#setInput(java.util.List)

initialize

public void initialize(TemplateManagementPresenter templatePresenter)
Initializes the view with presenter.

Specified by:
initialize in interface ITemplateManagementView
Parameters:
templatePresenter - a presenter
See Also:
initialize(pl.edu.agh.cast.importer.wizard.template.TemplateManagementPresenter)

dispose

public void dispose()

Overrides:
dispose in class org.eclipse.swt.widgets.Widget
See Also:
Widget.dispose()

showCannotRemoveTemplateError

public void showCannotRemoveTemplateError(IImportTemplate template,
                                          TemplateException e)
Notifies user that an error occurred removing a given template.

Specified by:
showCannotRemoveTemplateError in interface ITemplateManagementView
Parameters:
template - template which should be removed
e - an error
See Also:
#showCannotRemoveTemplateError(pl.edu.agh.cast.importer.base.template.IImportTemplate, pl.edu.agh.cast.importer.base.template.exception.TemplateException)

showNoTemplateSelectedInfo

public void showNoTemplateSelectedInfo()
Notifies user that no template is selected while trying to remove one.

Specified by:
showNoTemplateSelectedInfo in interface ITemplateManagementView
See Also:
ITemplateManagementView.showNoTemplateSelectedInfo()

showRemoveTemplateConfirmationQuestion

public int showRemoveTemplateConfirmationQuestion(IImportTemplate template)
Asks user if he/she wants to remove a given template.

Specified by:
showRemoveTemplateConfirmationQuestion in interface ITemplateManagementView
Parameters:
template - template to remove
Returns:
SWT.YES if user wants to remove the template
See Also:
#showRemoveTemplateConfirmationQuestion(pl.edu.agh.cast.importer.base.template.IImportTemplate)

selectionChanged

public void selectionChanged(IImportTemplate selected)
Notifies about template selection change.

Specified by:
selectionChanged in interface ITemplateSelectionListener
Parameters:
selected - actual selected template
See Also:
#selectionChanged(pl.edu.agh.cast.importer.base.template.IImportTemplate)


Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.