EGF Engine
Release 0.1.0

org.eclipse.egf.pattern.refactoring.move
Class MoveInfo

java.lang.Object
  extended by org.eclipse.egf.pattern.refactoring.move.MoveInfo

public class MoveInfo
extends Object

Move information.


Constructor Summary
MoveInfo()
           
 
Method Summary
 void addElementsToMove(Collection<AbstractPatternElement> elementsToMove_p)
          Add elements to elements to move.
 void addElementToMove(AbstractPatternElement element_p)
          Add an element to move.
 boolean checkDestinationType()
          Check if destination element is of correct type.
 NamedModelElementWithId getDestinationElement()
          Get destination element.
 Collection<AbstractPatternElement> getElementsToMove()
          Get elements to move.
 AbstractPatternElement getFirstElementToMove()
          Get first element to move.
 boolean isMoveAcceptable()
          Is move to destination element acceptable for elements to move ?
protected  boolean isRelevantElementToMove(AbstractPatternElement element_p)
          Make sure that given element is not already having destination element (if any specified) as a parent.
 void retainRelevantElementsToMove()
          Retain relevant elements to move only.
 void setDestinationElement(NamedModelElementWithId destinationElement_p)
          Set destination element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MoveInfo

public MoveInfo()
Method Detail

getElementsToMove

public Collection<AbstractPatternElement> getElementsToMove()
Get elements to move.

Returns:
Collection of AbstractPatternElement (being either a pattern or a library of patterns).

getFirstElementToMove

public AbstractPatternElement getFirstElementToMove()
Get first element to move.

Returns:
Null if no element to move is registered yet.

addElementsToMove

public void addElementsToMove(Collection<AbstractPatternElement> elementsToMove_p)
Add elements to elements to move.
Note that given collection is cloned, so it can be modified outside of MoveInfo.

Parameters:
elementsToMove_p - A not null and not empty collection of elements to move.

addElementToMove

public void addElementToMove(AbstractPatternElement element_p)
Add an element to move.

Parameters:
element_p - A not null element to move.

isRelevantElementToMove

protected boolean isRelevantElementToMove(AbstractPatternElement element_p)
Make sure that given element is not already having destination element (if any specified) as a parent.

Parameters:
element_p -
Returns:

isMoveAcceptable

public boolean isMoveAcceptable()
Is move to destination element acceptable for elements to move ?
For instance, a pattern can't be moved to the pattern viewpoint.

Returns:

retainRelevantElementsToMove

public void retainRelevantElementsToMove()
Retain relevant elements to move only.
That is, retain the elements that are not having the destination library as parent.
The modified collections is accessible through the getElementsToMove() method.


checkDestinationType

public boolean checkDestinationType()
Check if destination element is of correct type.

Returns:
true if so, false if not of correct type or null.

getDestinationElement

public NamedModelElementWithId getDestinationElement()
Get destination element.

Returns:

setDestinationElement

public void setDestinationElement(NamedModelElementWithId destinationElement_p)
Set destination element.

Parameters:
destinationElement_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.