EGF Engine
Release 0.1.0

org.eclipse.egf.core.ui.workbench.action.explorer.delete
Class DeleteModelElementAction

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
              extended by org.eclipse.egf.core.ui.workbench.action.explorer.delete.DeleteModelElementAction
Direct Known Subclasses:
DeleteContextAction, DeleteContextElementAction, DeleteContractElementAction, DeleteDomainAction, DeleteFactoryComponentInvocationAction, DeleteMappingAction, DeletePatternAction, DeletePatternLibraryAction, DeleteTaskFactoryHolderAction

public abstract class DeleteModelElementAction
extends AbstractModelElementAction

Base class to implement an action that deletes a model element object.


Constructor Summary
protected DeleteModelElementAction(Shell shell_p, ISelectionProvider selectionProvider_p, boolean readOnlyMode_p)
          Constructor.
 
Method Summary
protected  boolean closeEditor(NamedModelElementWithId modelElement_p)
          Close the editor related to given model element if any.
protected  boolean closeFileEditor(IFile modelElementFile_p, String editorId_p)
          Close the editor for given model element file (if an editor is open).
protected  void doDeleteModelElement()
          Performs the model element delete and call the closeEditor method.
protected abstract  String[] getConfirmDeleteMessage()
          Get the message used when displaying confirm delete dialog to the end-user.
protected  Wizard getWizardFor(NamedModelElementWithId modelElement_p)
          Get the wizard that handles with given model element.
 void run()
           
 void setUserConfirmationRequested(boolean userConfirmation_p)
          Set whether or not a user confirmation is requested when running.
 
Methods inherited from class org.eclipse.egf.core.ui.workbench.action.navigator.AbstractModelElementAction
computeImageDescriptorForModelElement, executeCommand, getEditingDomain, getModelElement, isReadOnly, openWizardDialog, setSelectedElement
 
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

DeleteModelElementAction

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

Parameters:
shell_p -
selectionProvider_p -
readOnlyMode_p -
Method Detail

setUserConfirmationRequested

public void setUserConfirmationRequested(boolean userConfirmation_p)
Set whether or not a user confirmation is requested when running.

Parameters:
userConfirmation_p -

run

public void run()
See Also:
org.eclipse.jface.action.Action#run()

doDeleteModelElement

protected void doDeleteModelElement()
Performs the model element delete and call the closeEditor method.


getConfirmDeleteMessage

protected abstract String[] getConfirmDeleteMessage()
Get the message used when displaying confirm delete dialog to the end-user.

Returns:

getWizardFor

protected Wizard getWizardFor(NamedModelElementWithId modelElement_p)
Description copied from class: AbstractModelElementAction
Get the wizard that handles with given model element.

Specified by:
getWizardFor in class AbstractModelElementAction
Parameters:
modelElement_p - the selected element that triggers this action.
Returns:
a not null Wizard instance.
See Also:
AbstractModelElementAction.getWizardFor(org.eclipse.egf.model.NamedModelElementWithId)

closeEditor

protected boolean closeEditor(NamedModelElementWithId modelElement_p)
Close the editor related to given model element if any.
Default implementation does nothing.

Parameters:
modelElement_p -
Returns:
true means the editor is correctly closed and given model element can be safely deleted.
Default implementation returns true.

closeFileEditor

protected boolean closeFileEditor(IFile modelElementFile_p,
                                  String editorId_p)
Close the editor for given model element file (if an editor is open).

Parameters:
modelElementFile_p - a file that an editor is open for.
editorId_p - the id of the editor responsible to open given model element.
Returns:
true if successfully performed.

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.