de.cau.cs.kieler.sim.kiem.ui.views
Class KiemView

java.lang.Object
  extended by org.eclipse.core.commands.common.EventManager
      extended by org.eclipse.ui.part.WorkbenchPart
          extended by org.eclipse.ui.part.ViewPart
              extended by de.cau.cs.kieler.sim.kiem.ui.views.KiemView
All Implemented Interfaces:
IAdaptable, IExecutableExtension, IPersistable, ISaveablePart, ISaveablePart2, IViewPart, IWorkbenchPart, IWorkbenchPart2, IWorkbenchPart3, IWorkbenchPartOrientation

public class KiemView
extends ViewPart
implements ISaveablePart2

The Class KiemView is only instantiated once when the view part is registered in the Eclipse IDE. It holds the DataComponent table list view and buttons to control the execution.

Rating proposed yellow
(2009-01-15)

Field Summary
static String VIEW_ID
          The Constant VIEW_ID.
 
Fields inherited from interface org.eclipse.ui.ISaveablePart2
CANCEL, DEFAULT, NO, YES
 
Fields inherited from interface org.eclipse.ui.ISaveablePart
PROP_DIRTY
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Constructor Summary
KiemView()
          The constructor of the Kiem View instance.
 
Method Summary
static void bringToFront()
          This method brings the Table view to the front.
 void createColumns(KiemTableViewer viewerParam)
          This will create the columns for the table.
 void createPartControl(Composite parentParam)
           
 KiemTableViewer createPartControl2(Composite parentParam, KiemTableViewer viewerParam)
          Creates the part control2.
 void doSave(IProgressMonitor monitor)
          
 void doSaveAs()
          
 AimedStepDurationTextField getAimedStepDurationTextField()
          Gets the aimed step duration text field.
static KiemView getInstance()
          Gets the single instance of KiemView.
 KiemPlugin getKIEMInstance()
          Gets the kIEM instance.
 boolean isDirty()
          
 boolean isSaveAsAllowed()
          
 boolean isSaveOnCloseNeeded()
          
 int promptToSaveOnClose()
          
 void setAllEnabled(boolean enabled)
          Sets the all actions (tool bar buttons and context menu entires) to enabled or disabled.
 void setAllEnabled(boolean enabled, KiemTableViewer viewerParam)
          Sets the all actions (tool bar buttons and context menu entires) to enabled or disabled.
 void setDirty(boolean isDirtyParam)
          Sets the dirty flag.
 void setFocus()
          Passing the focus request to the viewer's control.
 void setFocus(KiemTableViewer viewerParam)
          Passing the focus request to the viewer's control.
 void showError(String message)
          Show error dialog with the message.
 void showWarning(String message)
          Show warning dialog with the message.
 void updateEnabledEnabledDisabledUpDownAddDelete()
          Updates the enabled disabled status of the following actions:
- up
- down
- add
- delete.
 void updateEnabledEnabledDisabledUpDownAddDelete(KiemTableViewer viewerParam)
          Updates the enabled disabled status of the following actions:
- up
- down
- add
- delete.
 void updateStepsAsync()
          Updates steps in the steps text field asynchronously from within another thread.
protected  void updateView(boolean deselect)
          Updates the table if it is not busy.
 void updateView(boolean deselect, KiemTableViewer viewerParam)
          Updates the table if it is not busy.
 void updateViewAsync()
          Updates the table view asynchronously from within another thread.
 void updateViewAsyncKeepSelection()
          Updates the table view asynchronously from within another thread.
 void updateViewSync()
          Updates the table view synchronously from within another thread.
 
Methods inherited from class org.eclipse.ui.part.ViewPart
checkSite, getViewSite, init, init, saveState, setContentDescription, setInitializationData, setPartName
 
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, dispose, firePartPropertyChanged, firePropertyChange, getAdapter, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, getTitleToolTip, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
 
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, dispose, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

VIEW_ID

public static final String VIEW_ID
The Constant VIEW_ID.

See Also:
Constant Field Values
Constructor Detail

KiemView

public KiemView()
The constructor of the Kiem View instance.

Method Detail

getKIEMInstance

public KiemPlugin getKIEMInstance()
Gets the kIEM instance.

Returns:
the kIEM instance

getInstance

public static KiemView getInstance()
Gets the single instance of KiemView.

Returns:
single instance of KiemView

bringToFront

public static void bringToFront()
This method brings the Table view to the front.


createPartControl

public void createPartControl(Composite parentParam)
Specified by:
createPartControl in interface IWorkbenchPart
Specified by:
createPartControl in class WorkbenchPart

createPartControl2

public KiemTableViewer createPartControl2(Composite parentParam,
                                          KiemTableViewer viewerParam)
Creates the part control2.

Parameters:
parentParam - the parent param
viewerParam - the viewer param
Returns:
the kiem table viewer

createColumns

public void createColumns(KiemTableViewer viewerParam)
This will create the columns for the table.

Parameters:
viewerParam - the viewer

showWarning

public void showWarning(String message)
Show warning dialog with the message.

Parameters:
message - the message to present

showError

public void showError(String message)
Show error dialog with the message.

Parameters:
message - the message to present

setAllEnabled

public void setAllEnabled(boolean enabled)
Sets the all actions (tool bar buttons and context menu entires) to enabled or disabled. This method is used to block any user input during the initialization phase for example.

Parameters:
enabled - the new enabled status

setAllEnabled

public void setAllEnabled(boolean enabled,
                          KiemTableViewer viewerParam)
Sets the all actions (tool bar buttons and context menu entires) to enabled or disabled. This method is used to block any user input during the initialization phase for example.

Parameters:
enabled - the new enabled status
viewerParam - the viewer param

updateEnabledEnabledDisabledUpDownAddDelete

public void updateEnabledEnabledDisabledUpDownAddDelete()
Updates the enabled disabled status of the following actions:
- up
- down
- add
- delete.


updateEnabledEnabledDisabledUpDownAddDelete

public void updateEnabledEnabledDisabledUpDownAddDelete(KiemTableViewer viewerParam)
Updates the enabled disabled status of the following actions:
- up
- down
- add
- delete.

Parameters:
viewerParam - the viewer param

updateViewSync

public void updateViewSync()
Updates the table view synchronously from within another thread.

BE CAREFUL WITH USING THIS METHOD BECAUSE THIS COULD MORE EASILY PRODUCE DEADLOCKS


updateViewAsync

public void updateViewAsync()
Updates the table view asynchronously from within another thread.


updateViewAsyncKeepSelection

public void updateViewAsyncKeepSelection()
Updates the table view asynchronously from within another thread.


updateStepsAsync

public void updateStepsAsync()
Updates steps in the steps text field asynchronously from within another thread.


updateView

protected void updateView(boolean deselect)
Updates the table if it is not busy.

Parameters:
deselect - a table entry

updateView

public void updateView(boolean deselect,
                       KiemTableViewer viewerParam)
Updates the table if it is not busy.

Parameters:
deselect - a table entry
viewerParam - the viewer

getAimedStepDurationTextField

public AimedStepDurationTextField getAimedStepDurationTextField()
Gets the aimed step duration text field.

Returns:
the aimed step duration text field

setFocus

public void setFocus()
Passing the focus request to the viewer's control. This is necessary be- cause KiemView extends the ViewPart class.

Specified by:
setFocus in interface IWorkbenchPart
Specified by:
setFocus in class WorkbenchPart

setFocus

public void setFocus(KiemTableViewer viewerParam)
Passing the focus request to the viewer's control. This is necessary be- cause KiemView extends the ViewPart class.

Parameters:
viewerParam - the new focus

doSave

public void doSave(IProgressMonitor monitor)

Specified by:
doSave in interface ISaveablePart

doSaveAs

public void doSaveAs()

Specified by:
doSaveAs in interface ISaveablePart

isDirty

public boolean isDirty()

Specified by:
isDirty in interface ISaveablePart

setDirty

public void setDirty(boolean isDirtyParam)
Sets the dirty flag. Dirty means that the currentFile has been modified since the last save/load action.

Parameters:
isDirtyParam - the new dirty

isSaveAsAllowed

public boolean isSaveAsAllowed()

Specified by:
isSaveAsAllowed in interface ISaveablePart

isSaveOnCloseNeeded

public boolean isSaveOnCloseNeeded()

Specified by:
isSaveOnCloseNeeded in interface ISaveablePart

promptToSaveOnClose

public int promptToSaveOnClose()

Specified by:
promptToSaveOnClose in interface ISaveablePart2