EGF Engine
Release 0.1.0

org.eclipse.egf.core.ui.workbench.action.navigator
Class AbstractModelElementAction

java.lang.Object
  extended by Action
      extended by org.eclipse.egf.core.ui.workbench.action.navigator.AbstractNavigatorAction
          extended by org.eclipse.egf.core.ui.workbench.action.navigator.AbstractModelElementAction
Direct Known Subclasses:
AbstractCleanPatternElementAction, AbstractFactoryExecutionAction, CreateModelElementAction, DeleteModelElementAction, EditModelElementAction, OpenModelElementAction, ProducePatternElementAction, ValidateElementAction

public abstract class AbstractModelElementAction
extends AbstractNavigatorAction

Base class to implement action dealing with a model element.


Constructor Summary
protected AbstractModelElementAction(Shell shell_p, ISelectionProvider selectionProvider_p, boolean readOnlyMode_p)
          Constructor.
 
Method Summary
protected  ImageDescriptor computeImageDescriptorForModelElement(String pluginRelatedImagePath_p)
          Compute an image descriptor for a model element.
protected  void executeCommand(AdapterFactoryEditingDomain editingDomain_p, Command command_p)
          Execute the command.
protected  AdapterFactoryEditingDomain getEditingDomain()
          Get the editing domain.
 NamedModelElementWithId getModelElement()
          Get the editing model element.
protected abstract  Wizard getWizardFor(NamedModelElementWithId selectedModelElement_p)
          Get the wizard that handles with given model element.
protected  boolean isReadOnly()
          Whether or not the open wizard is in read only ?
protected  void openWizardDialog(Wizard wizard_p)
          Open a wizard dialog for given wizard.
 void setSelectedElement(Object object_p)
          Set given object as the selected object.
 
Methods inherited from class org.eclipse.egf.core.ui.workbench.action.navigator.AbstractNavigatorAction
getModelElementClass, getSelection, getSelectionProvider, getSharedImages, getShell, isSelectionCompatible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractModelElementAction

protected AbstractModelElementAction(Shell shell_p,
                                     ISelectionProvider selectionProvider_p,
                                     boolean readOnlyMode_p)
Constructor.

Parameters:
shell_p -
selectionProvider_p -
readOnlyMode_p - whether or not the open wizard is in read only.
Method Detail

setSelectedElement

public void setSelectedElement(Object object_p)
Description copied from class: AbstractNavigatorAction
Set given object as the selected object.

Specified by:
setSelectedElement in class AbstractNavigatorAction
See Also:
AbstractNavigatorAction.setSelectedElement(java.lang.Object)

getModelElement

public NamedModelElementWithId getModelElement()
Get the editing model element.

Returns:
the modelElement

executeCommand

protected void executeCommand(AdapterFactoryEditingDomain editingDomain_p,
                              Command command_p)
Execute the command.

Parameters:
editingDomain_p -
command_p -

getEditingDomain

protected AdapterFactoryEditingDomain getEditingDomain()
Get the editing domain.

Returns:

computeImageDescriptorForModelElement

protected ImageDescriptor computeImageDescriptorForModelElement(String pluginRelatedImagePath_p)
Compute an image descriptor for a model element.
The file related to the image must be related to FactoryComponentEditPlugin.

Returns:
an ImageDescriptor or null if not found.

isReadOnly

protected boolean isReadOnly()
Whether or not the open wizard is in read only ?

Returns:
the isReadOnly

getWizardFor

protected abstract Wizard getWizardFor(NamedModelElementWithId selectedModelElement_p)
Get the wizard that handles with given model element.

Parameters:
selectedModelElement_p - the selected element that triggers this action.
Returns:
a not null Wizard instance.

openWizardDialog

protected void openWizardDialog(Wizard wizard_p)
Open a wizard dialog for given wizard.

Parameters:
wizard_p -

EGF Engine
Release 0.1.0

Copyright (c) Thales Corporate Services S.A.S, 2009.

This page is made available under license. For full details see the LEGAL in the documentation book that contains this page.