|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cmu.sei.osate.ui.actions.AbstractAaxlAction
public abstract class AbstractAaxlAction
Abstract superclass for AaxlReadOnlyAction
and AaxlReadOnlyActionAsJob
. Contains
all the utility methods lookupPropertyDefinition(String, String)
,
lookupPropertyType(String, String)
, etc. Abstracts the Eclipse
job creation process. Calls createJob(AObject)
to get the
job to run. It is expected that the job invoke actionBody(IProgressMonitor, AObject)
.
This method initializes the OSATE action by creating the error reporter
manager, calling initPropertyReferences()
, etc., and finally
invokes doAaxlAction(IProgressMonitor, AObject)
to run the
specific analysis action body.
Users should not extend this class directly, but should extend
AaxlReadOnlyActionAsJob
.
Constructor Summary | |
---|---|
AbstractAaxlAction()
The constructor. |
Method Summary | |
---|---|
protected void |
actionBody(org.eclipse.core.runtime.IProgressMonitor monitor,
AObject root)
|
protected abstract org.eclipse.core.runtime.jobs.Job |
createJob(AObject root)
|
void |
dispose()
We can use this method to dispose of any system resources we previously allocated. |
protected abstract void |
doAaxlAction(org.eclipse.core.runtime.IProgressMonitor monitor,
AObject root)
This method will be defined by the ultimate subclass, and implements the true body of the action. |
protected void |
error(AObject obj,
java.lang.String msg)
Report error message on object as result of action. |
protected AnalysisErrorReporterFactory |
getAnalysisErrorReporterFactory()
Get the factory to be used to generate error reporters for this action. |
protected org.osgi.framework.Bundle |
getBundle()
Get the bundle ("plug-in") to attribute internal errors to. |
protected AnalysisErrorReporterFactory |
getDefaultAnalysisErrorReporterFactory()
Generate an error reporter factory that creates the default error reporters used by the analysis. |
protected AnalysisErrorReporterManager |
getErrorManager()
Get the error mananger used by the action. |
protected java.lang.String |
getMarkerType()
Get the type of the markers that the action might create. |
protected java.util.List |
getPropertyLookupErrors()
Get the property lookup errors. |
protected org.eclipse.swt.widgets.Shell |
getShell()
|
protected org.eclipse.ui.IWorkbenchWindow |
getWindow()
|
protected boolean |
hasPropertyLookupErrors()
Find out if there were any errors initializing the property references. |
protected void |
info(AObject obj,
java.lang.String msg)
Report an informative message on object as result of action. |
void |
init(org.eclipse.ui.IWorkbenchWindow window)
We will cache window object in order to be able to provide parent shell for the message dialog. |
protected void |
initPropertyReferences()
Plug-ins override this to initialize references to property definitions and constants that they use. |
protected void |
internalError(java.lang.Exception e)
Report an internal error in the operation of the action. |
protected void |
internalError(java.lang.String msg)
Report an internal error in the operation of the action. |
protected EnumLiteral |
lookupEnumerationLiteral(java.lang.String enumType,
java.lang.String literalName)
Lookup a particular enumeration literal from a predeclared property type, updating the error list if it or its declaring enumeration type is not found. |
protected EnumLiteral |
lookupEnumerationLiteral(java.lang.String ps,
java.lang.String enumType,
java.lang.String literalName)
Lookup a particular enumeration literal, updating the error list if it or its declaring enumeration type is not found. |
protected PropertyConstant |
lookupOptionalPropertyConstant(java.lang.String ps,
java.lang.String name)
Lookup a particular optional property constant definition. |
protected PropertyDefinition |
lookupOptionalPropertyDefinition(java.lang.String ps,
java.lang.String name)
Lookup a particular optional property definition. |
protected PropertyType |
lookupOptionalPropertyType(java.lang.String ps,
java.lang.String name)
Lookup a particular optional property type definition. |
protected PropertyConstant |
lookupPropertyConstant(java.lang.String name)
Lookup a particular property constant, updating the error list if it is not found. |
protected PropertyConstant |
lookupPropertyConstant(java.lang.String ps,
java.lang.String name)
Lookup a particular predeclared property constant, updating the error list if it is not found. |
protected PropertyDefinition |
lookupPropertyDefinition(java.lang.String name)
Lookup a particular predeclared property definition, updating the error list if it is not found. |
protected PropertyDefinition |
lookupPropertyDefinition(java.lang.String ps,
java.lang.String name)
Lookup a particular property definition, updating the error list if it is not found. |
protected PropertyType |
lookupPropertyType(java.lang.String name)
Lookup a particular predeclared property type, updating the error list if it is not found. |
protected PropertyType |
lookupPropertyType(java.lang.String ps,
java.lang.String name)
Lookup a particular property type, updating the error list if it is not found. |
protected UnitLiteral |
lookupUnitLiteral(java.lang.String unitType,
java.lang.String literalName)
Lookup a particular unit literal from a predeclared property type, updating the error list if it or its declaring unit type is not found. |
protected UnitLiteral |
lookupUnitLiteral(java.lang.String ps,
java.lang.String unitType,
java.lang.String literalName)
Lookup a particular unit literal, updating the error list if it or its declaring unit type is not found. |
protected boolean |
reportPropertyLookupErrors()
Check if there were property lookup errors and put up an error dialog box if there were. |
void |
run(org.eclipse.jface.action.IAction action)
The action has been activated. |
void |
selectionChanged(org.eclipse.jface.action.IAction action,
org.eclipse.jface.viewers.ISelection selection)
Selection in the workbench has been changed. |
void |
setActivePart(org.eclipse.jface.action.IAction action,
org.eclipse.ui.IWorkbenchPart targetPart)
|
protected boolean |
suppressErrorMessages()
Override this to return true if the default error
reporting mechanism should not be used. |
protected void |
warning(AObject obj,
java.lang.String msg)
Report warning message on object as result of action. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractAaxlAction()
Method Detail |
---|
public void setActivePart(org.eclipse.jface.action.IAction action, org.eclipse.ui.IWorkbenchPart targetPart)
setActivePart
in interface org.eclipse.ui.IObjectActionDelegate
IObjectActionDelegate.setActivePart(IAction, IWorkbenchPart)
public final void run(org.eclipse.jface.action.IAction action)
doAaxlAction(IProgressMonitor, AObject)
, by setting up a
UIJob
that invokes
(default visibility method) processAaxlAction
.
run
in interface org.eclipse.ui.IActionDelegate
protected final void actionBody(org.eclipse.core.runtime.IProgressMonitor monitor, AObject root)
protected abstract org.eclipse.core.runtime.jobs.Job createJob(AObject root)
protected void initPropertyReferences()
protected final PropertyDefinition lookupPropertyDefinition(java.lang.String ps, java.lang.String name)
null
if it is not
found.protected final PropertyDefinition lookupOptionalPropertyDefinition(java.lang.String ps, java.lang.String name)
null
if it is not
found.protected final PropertyDefinition lookupPropertyDefinition(java.lang.String name)
null
if it is not
found.protected final PropertyType lookupPropertyType(java.lang.String ps, java.lang.String name)
null
if it is not found.protected final UnitLiteral lookupUnitLiteral(java.lang.String ps, java.lang.String unitType, java.lang.String literalName)
null
if it or it's
declaring unit type is not found.protected final EnumLiteral lookupEnumerationLiteral(java.lang.String ps, java.lang.String enumType, java.lang.String literalName)
null
if it or it's
declaring enumeration type is not found.protected final PropertyType lookupOptionalPropertyType(java.lang.String ps, java.lang.String name)
null
if it is not found.protected final PropertyType lookupPropertyType(java.lang.String name)
null
if it is not found.protected final UnitLiteral lookupUnitLiteral(java.lang.String unitType, java.lang.String literalName)
null
if it or it's
declaring unit type is not found.protected final EnumLiteral lookupEnumerationLiteral(java.lang.String enumType, java.lang.String literalName)
null
if it or it's
declaring enumeration type is not found.protected final PropertyConstant lookupPropertyConstant(java.lang.String name)
null
if it is not found.protected final PropertyConstant lookupPropertyConstant(java.lang.String ps, java.lang.String name)
null
if it is not found.protected final PropertyConstant lookupOptionalPropertyConstant(java.lang.String ps, java.lang.String name)
null
if it is not found.protected final boolean hasPropertyLookupErrors()
protected final java.util.List getPropertyLookupErrors()
protected boolean suppressErrorMessages()
true
if the default error
reporting mechanism should not be used. By default the action will report
those property references that could not be found and avoids invoking
doAaxlAction(IProgressMonitor, AObject)
. If this method returns
true
then the error reporting will be suppressed and
doAaxlAction(IProgressMonitor, AObject)
will be invoked. The
intent here, however, is that the implementation of
doAaxlAction(IProgressMonitor, AObject)
will check whether there
were errors and report them in its own way. This is useful if the plug-in
has a more sophisticated initialziation process and could have additional
start up errors that it needs to report. The lookup errors are available
to the body of the action via getPropertyLookupErrors()
.
false
.protected final boolean reportPropertyLookupErrors()
protected abstract void doAaxlAction(org.eclipse.core.runtime.IProgressMonitor monitor, AObject root)
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
.
monitor
- The progress monitor to use to provide feedback about the
action and to check for cancellation.root
- The currently selected AObject in the workspace.
org.eclipse.core.runtime.OperationCanceledException
- Thrown if the method detected that the action has been
cancelled.public final void selectionChanged(org.eclipse.jface.action.IAction action, org.eclipse.jface.viewers.ISelection selection)
selectionChanged
in interface org.eclipse.ui.IActionDelegate
public void dispose()
dispose
in interface org.eclipse.ui.IWorkbenchWindowActionDelegate
IWorkbenchWindowActionDelegate.dispose()
public void init(org.eclipse.ui.IWorkbenchWindow window)
init
in interface org.eclipse.ui.IWorkbenchWindowActionDelegate
IWorkbenchWindowActionDelegate.init(org.eclipse.ui.IWorkbenchWindow)
protected final org.eclipse.ui.IWorkbenchWindow getWindow()
protected final org.eclipse.swt.widgets.Shell getShell()
protected java.lang.String getMarkerType()
MarkerAnalysisErrorReporter
for that marker type for
the resource being analyzed. Any existing markers of that type on the
resource will be removed.
Subclasses should override this method to change the marker type used by
the action. The initial implementation returns the generic
"AadlObjectMarker"
marker type, and will therefore cause
all existing OSATE markers to be removed from the resource.
"AadlObjectMarker"
.getDefaultAnalysisErrorReporterFactory()
,
getAnalysisErrorReporterFactory()
protected final AnalysisErrorReporterFactory getDefaultAnalysisErrorReporterFactory()
MarkerAnalysisErrorReporter
that generates
markers with the marker type determined by getMarkerType()
.
This method exists so that subclasses can override
getAnalysisErrorReporterFactory()
to create
factories that return instances of
ChainedAnalysisErrorReporter
where one of the delegate error reporters is the default error reporter.
getMarkerType()
,
getAnalysisErrorReporterFactory()
protected AnalysisErrorReporterFactory getAnalysisErrorReporterFactory()
getMarkerType()
,
getDefaultAnalysisErrorReporterFactory()
protected org.osgi.framework.Bundle getBundle()
Subclasses should override this method to return the bundle
in which they are located. The default value is to return the
bundle associated with edu.cmu.sei.osate.ui
.
protected final AnalysisErrorReporterManager getErrorManager()
protected final void error(AObject obj, java.lang.String msg)
obj
- Aobject that has been processed by the actionmsg
- The error messageprotected final void warning(AObject obj, java.lang.String msg)
obj
- Aobject that has been processed by the actionmsg
- The warning messageprotected final void info(AObject obj, java.lang.String msg)
obj
- Aobject that has been processed by the actionmsg
- The informative messageprotected final void internalError(java.lang.String msg)
protected final void internalError(java.lang.Exception e)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |