org.eclipse.amp.axf.ide.handlers
Class ModelRunHandler

java.lang.Object
  extended by org.eclipse.core.commands.common.EventManager
      extended by org.eclipse.core.commands.AbstractHandler
          extended by org.eclipse.amp.axf.ide.handlers.ModelRunHandler
All Implemented Interfaces:
ILifeCycleListener, IStateListener, IModelWorkbenchListener, org.eclipse.core.commands.IHandler, org.eclipse.core.commands.IHandler2
Direct Known Subclasses:
CloseHandler, PauseHandler, RestartHandler, ResumeHandler, StartHandler, StepHandler, StopHandler

public abstract class ModelRunHandler
extends org.eclipse.core.commands.AbstractHandler
implements ILifeCycleListener, IModelWorkbenchListener

The Class ModelRunHandler.


Constructor Summary
ModelRunHandler(EngineControl control)
          Instantiates a new model run handler.
 
Method Summary
 java.lang.Object execute(org.eclipse.core.commands.ExecutionEvent event)
           
 IEngine getRunner()
          Gets the runner.
 boolean isEnabled()
           
 void modelActivated(IModel model)
          Notifies the listener that the given model has been activated, that is in foreground and controllable.
 void modelAdded(IModel model)
          Model added.
 void modelRemoved(IModel model)
          Model removed.
 void notifyChange()
          Notify change.
 void observationEnd(IObservationProvider model)
          Notifies that the model is no longer providing observations.
 void observationEnding(IObservationProvider observed)
          Notifies that the model is about to be closed.
 void observeCreate(IObservationProvider observed)
          Notifies that the model has been instantiated but has not yet been initialized.
 void observeInitialize(IObservationProvider observed)
          Notifies that the model's initial state has been reached.
 void observeStart(IObservationProvider observed)
          Notifies that the model is just starting execution.
 void observeStop(IObservationProvider observed)
          Notifies that the model has stopped execution.
 void observeUpdate(IObservationProvider observed)
          Notifies that the model has completed one period of execution at the appropriate level of granularity.
 void observing(IObservationProvider model)
          Notifies that the model is now aware of this observer.
 void stateChange(java.lang.Object key, java.lang.Object updated)
          Notifies that the model has had some kind of state or observation status change.
 void viewActivated(org.eclipse.ui.IWorkbenchPart part)
          View activated.
 void viewAdded(org.eclipse.ui.IWorkbenchPart part)
          View added.
 void viewRemoved(org.eclipse.ui.IWorkbenchPart part)
          View removed.
 
Methods inherited from class org.eclipse.core.commands.AbstractHandler
addHandlerListener, dispose, fireHandlerChanged, hasListeners, isHandled, removeHandlerListener, setBaseEnabled, setEnabled
 
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
 

Constructor Detail

ModelRunHandler

public ModelRunHandler(EngineControl control)
Instantiates a new model run handler.

Parameters:
control - the control
Method Detail

execute

public java.lang.Object execute(org.eclipse.core.commands.ExecutionEvent event)
                         throws org.eclipse.core.commands.ExecutionException
Specified by:
execute in interface org.eclipse.core.commands.IHandler
Parameters:
event -
Returns:
Throws:
org.eclipse.core.commands.ExecutionException
See Also:
IHandler.execute(org.eclipse.core.commands.ExecutionEvent)

getRunner

public IEngine getRunner()
Gets the runner.

Returns:
the runner

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface org.eclipse.core.commands.IHandler
Overrides:
isEnabled in class org.eclipse.core.commands.AbstractHandler
Returns:
See Also:
AbstractHandler.isEnabled()

notifyChange

public void notifyChange()
Notify change.


observing

public void observing(IObservationProvider model)
Description copied from interface: ILifeCycleListener
Notifies that the model is now aware of this observer. Note that models may defer addition of listeners so a listener adding itself to a model should not assume that it has actually been added until this notification has occurred.

Specified by:
observing in interface ILifeCycleListener
Parameters:
model - the observed

observationEnd

public void observationEnd(IObservationProvider model)
Description copied from interface: ILifeCycleListener
Notifies that the model is no longer providing observations. Typically it has been disposed at this point.

Specified by:
observationEnd in interface ILifeCycleListener
Parameters:
model - the model removed event
See Also:
modelAdded

stateChange

public void stateChange(java.lang.Object key,
                        java.lang.Object updated)
Description copied from interface: IStateListener
Notifies that the model has had some kind of state or observation status change.

Specified by:
stateChange in interface IStateListener
Parameters:
key - the key
updated - the updated

modelActivated

public void modelActivated(IModel model)
Description copied from interface: IModelWorkbenchListener
Notifies the listener that the given model has been activated, that is in foreground and controllable. The model is not necessarily focused, nor even visible. Models can be executing but not activated. Note that this assumes that any already activated model is now deactivated, and it the listener's responsibility to keep a reference to that prior model as appropriate. Only one model may be active at any one time.

Specified by:
modelActivated in interface IModelWorkbenchListener
Parameters:
model - The model that is currently activated, or null if no models are now active. This usually indicates that no models exist.

modelAdded

public void modelAdded(IModel model)
Description copied from interface: IModelWorkbenchListener
Model added.

Specified by:
modelAdded in interface IModelWorkbenchListener
Parameters:
model - the model

modelRemoved

public void modelRemoved(IModel model)
Description copied from interface: IModelWorkbenchListener
Model removed.

Specified by:
modelRemoved in interface IModelWorkbenchListener
Parameters:
model - the model

viewActivated

public void viewActivated(org.eclipse.ui.IWorkbenchPart part)
Description copied from interface: IModelWorkbenchListener
View activated.

Specified by:
viewActivated in interface IModelWorkbenchListener
Parameters:
part - the part

viewAdded

public void viewAdded(org.eclipse.ui.IWorkbenchPart part)
Description copied from interface: IModelWorkbenchListener
View added.

Specified by:
viewAdded in interface IModelWorkbenchListener
Parameters:
part - the part

viewRemoved

public void viewRemoved(org.eclipse.ui.IWorkbenchPart part)
Description copied from interface: IModelWorkbenchListener
View removed.

Specified by:
viewRemoved in interface IModelWorkbenchListener
Parameters:
part - the part

observationEnding

public void observationEnding(IObservationProvider observed)
Description copied from interface: ILifeCycleListener
Notifies that the model is about to be closed. The model should still be available for observation at this point.

Specified by:
observationEnding in interface ILifeCycleListener
Parameters:
observed - the model event

observeCreate

public void observeCreate(IObservationProvider observed)
Description copied from interface: ILifeCycleListener
Notifies that the model has been instantiated but has not yet been initialized. At this point it is appropriate to update settings and parameterizations.

Specified by:
observeCreate in interface ILifeCycleListener
Parameters:
observed - the model event

observeInitialize

public void observeInitialize(IObservationProvider observed)
Description copied from interface: ILifeCycleListener
Notifies that the model's initial state has been reached.

Specified by:
observeInitialize in interface ILifeCycleListener
Parameters:
observed - the observed

observeStart

public void observeStart(IObservationProvider observed)
Description copied from interface: ILifeCycleListener
Notifies that the model is just starting execution.

Specified by:
observeStart in interface ILifeCycleListener
Parameters:
observed - the model event

observeStop

public void observeStop(IObservationProvider observed)
Description copied from interface: ILifeCycleListener
Notifies that the model has stopped execution. This does not imply that the model is dead, simply that it will no longer be executing within the context of the life-cycle. In particular, a model may be re-initialized and re-started.

Specified by:
observeStop in interface ILifeCycleListener
Parameters:
observed - the model event

observeUpdate

public void observeUpdate(IObservationProvider observed)
Description copied from interface: ILifeCycleListener
Notifies that the model has completed one period of execution at the appropriate level of granularity. Currently this is always once every period but that will change when more control of update granularity is introduced.

Specified by:
observeUpdate in interface ILifeCycleListener
Parameters:
observed - the model event