EGF Engine
Release 0.1.0

org.eclipse.egf.pattern.refactoring.internal.move.change
Class PatternElementChange

java.lang.Object
  extended by Change
      extended by org.eclipse.egf.pattern.refactoring.internal.move.change.PatternElementChange

public class PatternElementChange
extends Change


Constructor Summary
protected PatternElementChange(MoveInfo info_p)
          Constructor.
 
Method Summary
protected  Command createAddCommandToContainer(EditingDomain editingDomain_p, NamedModelElementWithId destinationContainer_p, AbstractPatternElement elementToMove_p)
          Create a new command for adding the element to a new container.
static Change createPatternElementChange(NamedModelElementWithId destinationElement_p, AbstractPatternElement patternElement_p)
          Create a new pattern element change with given parameters.
protected  Command createRemoveFromContainerCommand(EditingDomain editingDomain_p, NamedModelElementWithId container_p, AbstractPatternElement elementToMove_p)
          Create a new command for removing the element from its container.
 Object getModifiedElement()
           
 String getName()
           
protected  EReference getReferenceForContainer(NamedModelElementWithId container_p)
          Get containing reference for given container, that is hosting the element to move.
 void initializeValidationData(IProgressMonitor pm_p)
           
 RefactoringStatus isValid(IProgressMonitor pm_p)
           
 Change perform(IProgressMonitor pm_p)
           
protected  void updateElement(AbstractPatternElement patternElement_p, String parentFullId_p, String previousFcId_p, String destinationFcId_p)
          Update pattern element, including its subtree (if any).
protected  void updateModels(AbstractPatternElement elementToMove_p, NamedModelElementWithId previousContainingElement_p, NamedModelElementWithId destinationElement_p)
          Update models.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PatternElementChange

protected PatternElementChange(MoveInfo info_p)
Constructor.

Parameters:
info_p - The information data describing the move to perform.
Method Detail

getModifiedElement

public Object getModifiedElement()
See Also:
org.eclipse.ltk.core.refactoring.Change#getModifiedElement()

getName

public String getName()
See Also:
org.eclipse.ltk.core.refactoring.Change#getName()

initializeValidationData

public void initializeValidationData(IProgressMonitor pm_p)
See Also:
org.eclipse.ltk.core.refactoring.Change#initializeValidationData(org.eclipse.core.runtime.IProgressMonitor)

isValid

public RefactoringStatus isValid(IProgressMonitor pm_p)
                          throws CoreException,
                                 OperationCanceledException
Throws:
CoreException
OperationCanceledException
See Also:
org.eclipse.ltk.core.refactoring.Change#isValid(org.eclipse.core.runtime.IProgressMonitor)

perform

public Change perform(IProgressMonitor pm_p)
               throws CoreException
Throws:
CoreException
See Also:
org.eclipse.ltk.core.refactoring.Change#perform(org.eclipse.core.runtime.IProgressMonitor)

getReferenceForContainer

protected EReference getReferenceForContainer(NamedModelElementWithId container_p)
Get containing reference for given container, that is hosting the element to move.

Parameters:
container_p -
Returns:
null if container is of unexpected type.

createRemoveFromContainerCommand

protected Command createRemoveFromContainerCommand(EditingDomain editingDomain_p,
                                                   NamedModelElementWithId container_p,
                                                   AbstractPatternElement elementToMove_p)
Create a new command for removing the element from its container.

Parameters:
editingDomain_p -
container_p -
elementToMove_p -
Returns:
null if there is inconsistency in provided data.

createAddCommandToContainer

protected Command createAddCommandToContainer(EditingDomain editingDomain_p,
                                              NamedModelElementWithId destinationContainer_p,
                                              AbstractPatternElement elementToMove_p)
Create a new command for adding the element to a new container.
Also update model properties if needed.

Parameters:
editingDomain_p -
destinationContainer_p -
elementToMove_p -
Returns:

updateModels

protected void updateModels(AbstractPatternElement elementToMove_p,
                            NamedModelElementWithId previousContainingElement_p,
                            NamedModelElementWithId destinationElement_p)
Update models.

Parameters:
elementToMove_p -
previousContainingElement_p -
destinationElement_p -

updateElement

protected void updateElement(AbstractPatternElement patternElement_p,
                             String parentFullId_p,
                             String previousFcId_p,
                             String destinationFcId_p)
Update pattern element, including its subtree (if any).
IDs are updated on the basis of given parent one (root).

Parameters:
patternElement_p -
parentFullId_p -

createPatternElementChange

public static Change createPatternElementChange(NamedModelElementWithId destinationElement_p,
                                                AbstractPatternElement patternElement_p)
Create a new pattern element change with given parameters.

Parameters:
destinationElement_p - A not null destination element. Should be either a pattern library or the pattern viewpoint.
patternElement_p - A not null pattern element to move.
Returns:
a new Change that handles moving pattern element to destination library.

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.