EGF Engine
Release 0.1.0

org.eclipse.egf.model.edit.command.plugin.context
Class AbstractContextElementWrapperCommand

java.lang.Object
  extended by AbstractOverrideableCommand
      extended by org.eclipse.egf.model.edit.command.plugin.PluginChangeWrapperCommand
          extended by org.eclipse.egf.model.edit.command.plugin.context.AbstractContextElementWrapperCommand
Direct Known Subclasses:
AddContextElementWrapperCommand, RemoveContextElementWrapperCommand, SetContextElementWrapperCommand

public abstract class AbstractContextElementWrapperCommand
extends PluginChangeWrapperCommand

Base class to implement a command that wraps a context extension processing.


Constructor Summary
AbstractContextElementWrapperCommand(EditingDomain domain_p, EObject modelElement_p, EStructuralFeature feature_p, Object value_p)
          Constructor.
 
Method Summary
 boolean doCanUndo()
           
protected  String getContextId()
          Returns the context id of model element object.
protected  List<IPluginChangesCommand> handleContextElement(ContextElement contextElement_p)
          Handle a context to be set or created.
protected  void handleContextElementBasedOnContractElementReference(List<IPluginChangesCommand> commands_p, ContextElement contextElement_p, ContractElementReference contractElementReference_p, String contextId_p, String contextElementId_p, String contextElementValue_p)
          Handle a context element based on a contract element reference.
protected  void handleContextElementBasedOnKey(List<IPluginChangesCommand> commands_p, ContextElement contextElement_p, String contextId_p, String contextElementId_p, String contextElementValue_p)
          Handle a context element based on a key.
protected  void removeContextElement(List<IPluginChangesCommand> commands_p, String contextId, String contextElementId, ContextElement contextElement_p)
          Remove (in plug-in file) given context element from given context.
protected  void removePreviousContractElementReference(List<IPluginChangesCommand> commands_p, ContextElement contextElement_p)
          Remove the previous contract element reference if any.
 
Methods inherited from class org.eclipse.egf.model.edit.command.plugin.PluginChangeWrapperCommand
doExecute, doRedo, doUndo, getCommandRunner, getExecutablePluginChangeCommand, getFeature, getMDSoFaPde, getModelElement, getPluginId, getRedoablePluginChangeCommand, getUndoablePluginChangeCommand, getValue, prepare, setPluginId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractContextElementWrapperCommand

public AbstractContextElementWrapperCommand(EditingDomain domain_p,
                                            EObject modelElement_p,
                                            EStructuralFeature feature_p,
                                            Object value_p)
Constructor.

Parameters:
domain_p -
modelElement_p -
feature_p -
value_p -
Method Detail

getContextId

protected String getContextId()
Returns the context id of model element object.

Returns:

handleContextElement

protected List<IPluginChangesCommand> handleContextElement(ContextElement contextElement_p)
Handle a context to be set or created.

Parameters:
contextElement_p -
Returns:

handleContextElementBasedOnKey

protected void handleContextElementBasedOnKey(List<IPluginChangesCommand> commands_p,
                                              ContextElement contextElement_p,
                                              String contextId_p,
                                              String contextElementId_p,
                                              String contextElementValue_p)
Handle a context element based on a key.

Parameters:
commands_p -
contextElement_p -
contextId_p -
contextElementId_p -
contextElementValue_p -

handleContextElementBasedOnContractElementReference

protected void handleContextElementBasedOnContractElementReference(List<IPluginChangesCommand> commands_p,
                                                                   ContextElement contextElement_p,
                                                                   ContractElementReference contractElementReference_p,
                                                                   String contextId_p,
                                                                   String contextElementId_p,
                                                                   String contextElementValue_p)
Handle a context element based on a contract element reference.

Parameters:
commands_p -
contextElement_p -
contextId_p -
contextElementId_p -
contextElementValue_p -

removeContextElement

protected void removeContextElement(List<IPluginChangesCommand> commands_p,
                                    String contextId,
                                    String contextElementId,
                                    ContextElement contextElement_p)
Remove (in plug-in file) given context element from given context.

Parameters:
commands_p -
contextId -
contextElementId -
contextElement_p -

removePreviousContractElementReference

protected void removePreviousContractElementReference(List<IPluginChangesCommand> commands_p,
                                                      ContextElement contextElement_p)
Remove the previous contract element reference if any.

Parameters:
commands_p -
contextElement_p -

doCanUndo

public boolean doCanUndo()
Overrides:
doCanUndo in class PluginChangeWrapperCommand
See Also:
PluginChangeWrapperCommand.doCanUndo()

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.