de.cau.cs.kieler.sim.kiem.config.ui
Class ScheduleSelector

java.lang.Object
  extended by org.eclipse.jface.action.ContributionItem
      extended by org.eclipse.jface.action.ControlContribution
          extended by de.cau.cs.kieler.sim.kiem.config.ui.ScheduleSelector
All Implemented Interfaces:
IKiemConfigEventListener, EventListener, IContributionItem, FocusListener, SelectionListener, org.eclipse.swt.internal.SWTEventListener

public class ScheduleSelector
extends ControlContribution
implements SelectionListener, FocusListener, IKiemConfigEventListener

The selection combobox for loading saved schedules.

Rating proposed yellow
(2010-01-27)

Constructor Summary
ScheduleSelector(int type)
          Creates a new configuration selection box.
 
Method Summary
protected  Control createControl(Composite parent)
          
 void dispose()
          
 void eventDispatched(KiemConfigEvent event)
          Act on an event dispatched by the manager.
 void focusGained(FocusEvent e)
          
 void focusLost(FocusEvent e)
          
 ScheduleData getSelection()
          Getter for the current selection in the combo.
 boolean isEnabled()
           
 boolean isVisible()
          
 void setEnabled(boolean enabled)
           
 void update()
          
 void widgetDefaultSelected(SelectionEvent e)
          
 void widgetSelected(SelectionEvent e)
          
 
Methods inherited from class org.eclipse.jface.action.ControlContribution
computeWidth, fill, fill, fill
 
Methods inherited from class org.eclipse.jface.action.ContributionItem
fill, getId, getParent, isDirty, isDynamic, isGroupMarker, isSeparator, saveWidgetState, setId, setParent, setVisible, toString, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScheduleSelector

public ScheduleSelector(int type)
Creates a new configuration selection box.

Parameters:
type - the type of the selector. either ContributionManager.RECENT_COMBO or ContributionManager.MATCHING_COMBO.
Method Detail

createControl

protected Control createControl(Composite parent)

Specified by:
createControl in class ControlContribution

setEnabled

public void setEnabled(boolean enabled)

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface IContributionItem
Overrides:
isEnabled in class ContributionItem

dispose

public void dispose()

Specified by:
dispose in interface IContributionItem
Overrides:
dispose in class ContributionItem

update

public void update()

Specified by:
update in interface IContributionItem
Overrides:
update in class ContributionItem

getSelection

public ScheduleData getSelection()
Getter for the current selection in the combo.

Returns:
the current selection or null

isVisible

public boolean isVisible()

Specified by:
isVisible in interface IContributionItem
Overrides:
isVisible in class ContributionItem

widgetDefaultSelected

public void widgetDefaultSelected(SelectionEvent e)

Specified by:
widgetDefaultSelected in interface SelectionListener

widgetSelected

public void widgetSelected(SelectionEvent e)

Specified by:
widgetSelected in interface SelectionListener

focusGained

public void focusGained(FocusEvent e)

Specified by:
focusGained in interface FocusListener

focusLost

public void focusLost(FocusEvent e)

Specified by:
focusLost in interface FocusListener

eventDispatched

public void eventDispatched(KiemConfigEvent event)
Act on an event dispatched by the manager.

Specified by:
eventDispatched in interface IKiemConfigEventListener
Parameters:
event - the dispatched event.