|
Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.gmf.runtime.diagram.core.util.ViewRefactorHelper
public class ViewRefactorHelper
A helper class to perform notational refactoring based on a semantic refactoring. The helper provides a typical or generic implementation of the refactoring operation based on the Notation metamodel. However, if the notations being refactoring use other extended notation metamodels, the implementation of this helper class might need to be extended. This can be achieved by directly subclassing this helper class.
Constructor Summary | |
---|---|
ViewRefactorHelper()
Constructs a new ViewRefactorHelper with a given preferences hint |
|
ViewRefactorHelper(PreferencesHint preferencesHint)
Constructs a new ViewRefactorHelper with a given preferences hint |
Method Summary | |
---|---|
protected void |
copyDiagramFeatures(Diagram oldDiagram,
Diagram newDiagram)
Copies the notational features of the old diagram to the new diagram |
protected void |
copyEdgeFeatures(Edge oldEdge,
Edge newEdge)
Copies the notational features of the old edge to the new edge |
protected void |
copyNodeFeatures(Node oldNode,
Node newNode)
Copies the notational features of the old node to the new node |
void |
copyViewAppearance(View oldView,
View newView,
java.util.List excludeStyles)
Copies the appearance of the old view to the new view. |
protected void |
copyViewChild(View oldView,
View newView,
Node oldChildNode)
If the child view has the same element as the parent and also has a type, it is considered a subview and therefore only its properties are copied to matching subviews (if any) of the new parent. |
protected void |
copyViewChildren(View oldView,
View newView)
Copies the notational properties of the old view children to the new view children |
protected void |
copyViewFeatures(View oldView,
View newView)
Copies the notational features of the old view to the new view |
protected void |
copyViewStyle(View oldView,
View newView,
Style oldStyle,
java.util.List excludeStyles)
Copies the given style features of the old view to the new view |
protected void |
copyViewStyles(View oldView,
View newView)
Copies the style features of the old view to the new view |
protected void |
copyViewStyles(View oldView,
View newView,
java.util.List excludeStyles)
Copies all styles feature from the old view to the new view |
protected Diagram |
createDiagram(Diagram oldDiagram,
org.eclipse.emf.ecore.EObject newElement)
A utility to create a new diagram for the given new element that would replace the given old diagram. |
protected Edge |
createEdge(Edge oldEdge,
org.eclipse.emf.ecore.EObject newElement)
A utility to create a new edge for the given new element that would replace the given old edge. |
protected Node |
createNode(Node oldNode,
org.eclipse.emf.ecore.EObject newElement)
A utility to create a new node for the given new element that would replace the given old node. |
protected java.lang.String |
getNewViewType(View oldView,
org.eclipse.emf.ecore.EObject newElement)
Returns the type of the new view that replaces the old one |
PreferencesHint |
getPreferencesHint()
Returns the preferences hint |
protected java.util.Collection |
getReferencingViews(org.eclipse.emf.ecore.EObject element)
A utility to get all the views of the given element to be refactored. |
void |
refactor(org.eclipse.emf.ecore.EObject oldElement,
org.eclipse.emf.ecore.EObject newElement)
Refactors the notations associated with the old element to make them consistent with the new element. |
protected Diagram |
refactorDiagram(Diagram oldDiagram,
org.eclipse.emf.ecore.EObject newElement)
Refactors an old diagram to a new one with the given new element |
protected void |
refactorDiagramLinks(Diagram oldDiagram,
Diagram newDiagram)
|
protected Edge |
refactorEdge(Edge oldEdge,
org.eclipse.emf.ecore.EObject newElement)
Refactors an old edge to a new one with the given new element |
protected void |
refactorGuides(Node oldNode,
Node newNode)
Refactors the diagram guides to reference the new node instead of the old one |
protected Node |
refactorNode(Node oldNode,
org.eclipse.emf.ecore.EObject newElement)
Refactors an old node to a new one with the given new element |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ViewRefactorHelper()
ViewRefactorHelper
with a given preferences hint
public ViewRefactorHelper(PreferencesHint preferencesHint)
ViewRefactorHelper
with a given preferences hint
preferencesHint
- The preferences hint to be used to perform refactoringMethod Detail |
---|
public PreferencesHint getPreferencesHint()
public void refactor(org.eclipse.emf.ecore.EObject oldElement, org.eclipse.emf.ecore.EObject newElement)
oldElement
- The semantic element being refactorednewElement
- The semantic element that replaces the refactored oneprotected Node refactorNode(Node oldNode, org.eclipse.emf.ecore.EObject newElement)
oldNode
- The old node being refactorednewElement
- The replacing new element
protected Edge refactorEdge(Edge oldEdge, org.eclipse.emf.ecore.EObject newElement)
oldEdge
- The old edge being refactorednewElement
- The replacing new element
protected Diagram refactorDiagram(Diagram oldDiagram, org.eclipse.emf.ecore.EObject newElement)
oldDiagram
- The old diagram being refactorednewElement
- The replacing new element
protected void refactorDiagramLinks(Diagram oldDiagram, Diagram newDiagram)
protected void copyNodeFeatures(Node oldNode, Node newNode)
oldNode
- The old node to copy features fromnewNode
- The new node to copy features toprotected void copyEdgeFeatures(Edge oldEdge, Edge newEdge)
oldEdge
- The old edge to copy features fromnewEdge
- The new edge to copy features toprotected void copyDiagramFeatures(Diagram oldDiagram, Diagram newDiagram)
oldDiagram
- The old diagram to copy features fromnewDiagram
- The new diagram to copy features toprotected void copyViewFeatures(View oldView, View newView)
oldView
- The old view to copy features fromnewView
- The new view to copy features topublic void copyViewAppearance(View oldView, View newView, java.util.List excludeStyles)
oldView
- The old view to copy style features fromnewView
- The new view to copy style features toexcludeStyles
- the List
of Style.eClass
types to exclude
from the copy operation.protected void copyViewStyles(View oldView, View newView)
oldView
- The old view to copy style features fromnewView
- The new view to copy style features toprotected void copyViewStyles(View oldView, View newView, java.util.List excludeStyles)
oldView
- The old view to copy style features fromnewView
- The new view to copy style features toexcludeStyles
- the List
of Style.eClass
types to exclude
from the copy operation.protected void copyViewStyle(View oldView, View newView, Style oldStyle, java.util.List excludeStyles)
oldView
- The old view to copy style features fromnewView
- The new view to copy style features tooldStyle
- The old style to copyexcludeStyles
- the list of Style.eClass
types to excludeprotected void copyViewChildren(View oldView, View newView)
oldView
- The old view to copy children notational features fromnewView
- The new view to copy children notational features toprotected void copyViewChild(View oldView, View newView, Node oldChildNode)
oldView
- The old view to copy children notational features fromnewView
- The new view to copy children notational features tooldChildNode
- A child node of the old viewprotected final void refactorGuides(Node oldNode, Node newNode)
oldNode
- The old node being refactorednewNode
- The replacing new nodeprotected java.util.Collection getReferencingViews(org.eclipse.emf.ecore.EObject element)
element
- The element referenced by views to be refactored
protected Node createNode(Node oldNode, org.eclipse.emf.ecore.EObject newElement)
oldNode
- The old node being refactorednewElement
- The new element to create a node on
protected Edge createEdge(Edge oldEdge, org.eclipse.emf.ecore.EObject newElement)
oldEdge
- The old edge being refactorednewElement
- The new element to create a edge on
protected Diagram createDiagram(Diagram oldDiagram, org.eclipse.emf.ecore.EObject newElement)
oldDiagram
- The old diagram being refactorednewElement
- The new element to create a diagram on
protected java.lang.String getNewViewType(View oldView, org.eclipse.emf.ecore.EObject newElement)
oldView
- The old view being replacednewElement
- The new element of the new view
|
Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.