edu.cmu.sei.osate.ui.actions
Class AbstractInstanceOrDeclarativeModelReadOnlyAction

java.lang.Object
  extended by edu.cmu.sei.osate.ui.actions.AbstractAaxlAction
      extended by edu.cmu.sei.osate.ui.actions.AaxlReadOnlyActionAsJob
          extended by edu.cmu.sei.osate.ui.actions.AbstractInstanceOrDeclarativeModelReadOnlyAction
All Implemented Interfaces:
org.eclipse.ui.IActionDelegate, org.eclipse.ui.IObjectActionDelegate, org.eclipse.ui.IWorkbenchWindowActionDelegate
Direct Known Subclasses:
AbstractInstanceOrDeclarativeModelModifyActionAction

public abstract class AbstractInstanceOrDeclarativeModelReadOnlyAction
extends AaxlReadOnlyActionAsJob


Constructor Summary
protected AbstractInstanceOrDeclarativeModelReadOnlyAction()
           
 
Method Summary
protected abstract  void analyzeDeclarativeModel(org.eclipse.core.runtime.IProgressMonitor monitor, AnalysisErrorReporterManager errManager, AObject declarativeObject)
          Analyze the model starting from a declarative model element.
protected  boolean analyzeInSingleModeOnly()
          Should instance models be analyzed in a single mode only?
protected abstract  void analyzeInstanceModel(org.eclipse.core.runtime.IProgressMonitor monitor, AnalysisErrorReporterManager errManager, SystemInstance root, SystemOperationMode som)
          Analyze a system instance model in a particular system operation mode.
 void doAaxlAction(org.eclipse.core.runtime.IProgressMonitor monitor, AObject obj)
          This method will be defined by the ultimate subclass, and implements the true body of the action.
protected  boolean initializeAnalysis()
          Initialize the state of analysis.
 
Methods inherited from class edu.cmu.sei.osate.ui.actions.AaxlReadOnlyActionAsJob
createJob, getActionName
 
Methods inherited from class edu.cmu.sei.osate.ui.actions.AbstractAaxlAction
actionBody, dispose, error, getAnalysisErrorReporterFactory, getBundle, getDefaultAnalysisErrorReporterFactory, getErrorManager, getMarkerType, getPropertyLookupErrors, getShell, getWindow, hasPropertyLookupErrors, info, init, initPropertyReferences, internalError, internalError, lookupEnumerationLiteral, lookupEnumerationLiteral, lookupOptionalPropertyConstant, lookupOptionalPropertyDefinition, lookupOptionalPropertyType, lookupPropertyConstant, lookupPropertyConstant, lookupPropertyDefinition, lookupPropertyDefinition, lookupPropertyType, lookupPropertyType, lookupUnitLiteral, lookupUnitLiteral, reportPropertyLookupErrors, run, selectionChanged, setActivePart, suppressErrorMessages, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractInstanceOrDeclarativeModelReadOnlyAction

protected AbstractInstanceOrDeclarativeModelReadOnlyAction()
Method Detail

analyzeInSingleModeOnly

protected boolean analyzeInSingleModeOnly()
Should instance models be analyzed in a single mode only? If this returns true, then the user is not allowed to choose to analyze the model in all modes.

The default implementation returns false.


doAaxlAction

public final void doAaxlAction(org.eclipse.core.runtime.IProgressMonitor monitor,
                               AObject obj)
Description copied from class: AbstractAaxlAction
This method will be defined by the ultimate subclass, and implements the true body of the action. It is invoked along a call chain from the AbstractAaxlAction.run(IAction) method, which first makes sure the OSATE environment is loaded and other house cleaning things.

It is a good idea, although not required, for the action to check to see if the action has been cancelled. If cancellation is detected, this method should throw the unchecked exception OperationCanceledException.

Specified by:
doAaxlAction in class AbstractAaxlAction
Parameters:
monitor - The progress monitor to use to provide feedback about the action and to check for cancellation.
obj - The currently selected AObject in the workspace.

initializeAnalysis

protected boolean initializeAnalysis()
Initialize the state of analysis. For example, this can open a dialog box to get additional parameters to the analysis. The analysis state should be initialized by setting fields that are then used by analyzeDeclarativeModel(org.eclipse.core.runtime.IProgressMonitor, edu.cmu.sei.aadl.model.pluginsupport.AnalysisErrorReporterManager, edu.cmu.sei.aadl.model.core.AObject) and analyzeInstanceModel(org.eclipse.core.runtime.IProgressMonitor, edu.cmu.sei.aadl.model.pluginsupport.AnalysisErrorReporterManager, edu.cmu.sei.aadl.model.instance.SystemInstance, edu.cmu.sei.aadl.model.instance.SystemOperationMode).

The default implementation of this method simply returns true.

Returns:
true if the analysis should proceed or false if the user cancelled the analysis.

analyzeDeclarativeModel

protected abstract void analyzeDeclarativeModel(org.eclipse.core.runtime.IProgressMonitor monitor,
                                                AnalysisErrorReporterManager errManager,
                                                AObject declarativeObject)
Analyze the model starting from a declarative model element.

Parameters:
monitor - The progress monitor to use.
errManager - The error manager to use. This is the same as error manager that AbstractAaxlAction.getErrorManager() returns. It is provided here as a convenience.
declarativeObject - The declarative object.

analyzeInstanceModel

protected abstract void analyzeInstanceModel(org.eclipse.core.runtime.IProgressMonitor monitor,
                                             AnalysisErrorReporterManager errManager,
                                             SystemInstance root,
                                             SystemOperationMode som)
Analyze a system instance model in a particular system operation mode. The model is already projected into the given SOM, and the error manager has been adjusted to report errors relative to that SOM.

Parameters:
monitor - The progress monitor to use.
errManager - The error manager to use. This is the same as error manager that AbstractAaxlAction.getErrorManager() returns. It is provided here as a convenience.
root - The system instance model.
som - The system operation mode that the model is projected into.