|
UML Modeling Layer | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ibm.xtools.uml.msl.internal.redefinition.RedefInternalUtil
com.ibm.xtools.uml.msl.internal.redefinition.RedefUtil
public class RedefUtil
Redefinition utilities for structure & state diagrams
| Nested Class Summary | |
|---|---|
static class |
RedefUtil.ElementWithRedefinitionContext
|
static interface |
RedefUtil.IRedefintionContextAccessor
|
| Nested classes/interfaces inherited from class com.ibm.xtools.uml.msl.internal.redefinition.RedefInternalUtil |
|---|
RedefInternalUtil.ContainmentTester |
| Field Summary | |
|---|---|
static String |
CONTEXT_HINT
|
static String |
EDIT_REQUEST_PARAM_SUPRESS_UI
|
protected static RedefUtil |
redefUtilInstance
|
static String |
REFACTORING_ROOT_FRAGMENT_REMOVAL
|
| Fields inherited from class com.ibm.xtools.uml.msl.internal.redefinition.RedefInternalUtil |
|---|
defaultContainmentTester, EMPTY_BEHAVIOR_BODY, uml2 |
| Constructor Summary | |
|---|---|
RedefUtil()
|
|
| Method Summary | |
|---|---|
static boolean |
canRedefine(Element el,
EObject contextHint)
Answers whether the element in question is redefinable in the context of a specialized class |
static boolean |
canRedefine(RedefUtil.ElementWithRedefinitionContext elementWithContext)
Answers whether the element in question is redefinable in the context of a specialized class |
static boolean |
canReinherit(Element element,
EObject contextHint)
|
static boolean |
canReinheritViewTarget(View view)
|
static void |
changeRedefinitionRoot(Element newRoot,
Element oldRoot)
Change the root fragment of existing redefinition hierarchy tree from oldRoot to newRoot |
static void |
copyAllRedefinableContent(Element source,
Element target)
|
static void |
copyLocalRedefinableContent(Element source,
Element target)
|
static void |
copySharedContent(Element source,
Element target)
|
static Object |
getAdapterForEditPart(Class key,
View view)
|
static List |
getAffectedFilesFromContextHint(IEditCommandRequest request)
Returns the affected files list based on the redefinition context hint stored with the request parameters |
static List |
getAllStructuralFeatureContent(Element element,
EObject contextHint,
EStructuralFeature sf)
|
static StateMachine |
getContainingStateMachine(EObject eObject)
Returns containing state machine |
static EObject |
getContextHint(Map parameters)
|
static Map |
getContextHintMap(EObject hint)
|
static Element |
getContextualFragment(Element element,
EObject contextHint)
Finds an element that redefines the given element in the given context or the context closest to the given context |
static Element |
getContextualFragment(RedefUtil.ElementWithRedefinitionContext elementWithContext)
|
static Collection |
getInheritanceTree(Classifier clazz)
|
static List |
getInheritedContent(EObject element,
EReference slot)
returns inherited content of the given structural feature |
static RedefUtil |
getInstance()
|
static Classifier |
getLocalContext(EObject element)
Returns local context for the given element. |
static Classifier |
getLocalContextFromHint(Element element,
EObject contextHint)
|
static Classifier |
getLocalContextFromHint(EObject contextHint)
Deprecated. Use getLocalContextFromHint(Element element, EObject contextHint) method instead |
static Classifier |
getLocalContextIfExists(EObject element)
Returns local context for the given element. |
static Element |
getLocalFragment(Element element,
EObject contextHint)
|
RedefinableStructuralFeature[] |
getRedefinableFeatures()
|
static RedefinableElement |
getRedefinedElement(Element element)
|
static Element |
getRedefinedElementOrSuperClass(Element fragment)
|
static Collection |
getRedefinitions(Element redefElement)
|
static EReference |
getRedefinitionStructuralFeature(RedefinableElement el)
|
static Collection |
getRedefinitionTree(RedefinableElement element)
|
static List |
getReferencesTargets(Collection candidates,
EObject contextHint)
Returns collection of semantic elements that the views should keep as their target. |
static Element |
getReferenceTarget(Element candidate,
EObject contextHint)
Returns semantic element that the view should keep as its target. |
static IAdaptable |
getReferenceTarget(IAdaptable candidate,
EObject contextHint)
Returns semantic element that the view should keep as its target. |
static Element |
getRootFragment(Element element)
Follows the redefinition chain and returns the first fragment in the chain, the one who does not redefine any other element. |
static EStructuralFeature[] |
getSharedFeatures()
|
static Object |
getStereotypeValue(Element element,
EObject contextHint,
String stereotypeName,
String valueName)
|
static Collection |
getSubclasses(Classifier clazz)
|
static Object |
getValue(EStructuralFeature feature,
Element element,
EObject contextHint)
Given an element, redefinition context hint and the feature returns the value object |
static boolean |
isEventBrokerRedefinitionAware()
|
static boolean |
isExcluded(Element contextualFragment)
|
static boolean |
isExcluded(Element rootFragment,
EObject redefinitionContextHint)
|
static boolean |
isFragmentRemovalRefactoring(Element element)
|
static boolean |
isInheritable(Element el,
EObject contextHint)
Answers whether the element in question can be inherited in the given context |
static boolean |
isInherited(Element element,
EObject contextHint)
|
static boolean |
isLocal(Element element,
EObject contextHint)
Returns FALSE if given fragment is owned by a context different from one identified by contextHint argument. |
static boolean |
isRedefinitionContextValid(Classifier elementContext,
Classifier contextHintContext)
Check to see if the context of the element in question is a generalization of the context of contextHint...only then is redefinition valid |
static boolean |
isRedefinitionStructuredFeature(Object sf)
|
static boolean |
isStereotypePropertyRedefinable(Stereotype stereotype,
String propertyName)
Will return whether this stereotype property is redefinable or not |
static boolean |
isStereotypeValueInherited(Element element,
EObject contextHint,
String stereotypeName,
String valueName)
|
static boolean |
isUISuppressed(Map params)
Tests if the parameter map contains the RedefUtil.EDIT_REQUEST_PARAM_SUPRESS_UI parameter |
static boolean |
isUMLRedefinitionStructuralFeature(EReference sf)
|
static boolean |
isValueLocal(EStructuralFeature feature,
Element element,
EObject contextHint)
|
static void |
markFragmentRemovalRefactoring(Element element)
|
static EObject |
normalizeContextHint(Element semanticElement,
EObject contextHint)
|
static Element |
redefine(Element el,
EObject contextHint)
redefines given redefinable element in the context of a specialized class |
static Element |
redefine(RedefUtil.ElementWithRedefinitionContext elementWithContext)
|
static void |
reinherit(Element element)
|
static void |
removeFragment(Element element)
Remove given root fragment and make the immediate redefining fragments new root ones |
static void |
separate(Element fragment,
boolean absorbInheritedContent)
Detaches given redefining fragment from the fragment it redefines |
static void |
setRedefinition(Element redefining,
Element redefined)
Sets redefinition relationship between two existing fragments |
static void |
setSupressUIParam(Map params,
boolean suppress)
Sets the RedefUtil.EDIT_REQUEST_PARAM_SUPRESS_UI parameter into the parameter map |
static Element |
unexclude(RedefinableElement contextualFragment)
|
| Methods inherited from class com.ibm.xtools.uml.msl.internal.redefinition.RedefInternalUtil |
|---|
filterBySF, findBody, findBody, findOwner, findOwner, findSubclasses, findSubclasses, getContainedElement, getContextChain, getExclusionSupport, getRedefSupport, retargetReferences, retargetReferencesDownTheContextChain |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static RedefUtil redefUtilInstance
public static final String CONTEXT_HINT
public static final String REFACTORING_ROOT_FRAGMENT_REMOVAL
public static final String EDIT_REQUEST_PARAM_SUPRESS_UI
| Constructor Detail |
|---|
public RedefUtil()
| Method Detail |
|---|
public static RedefUtil getInstance()
public static void setSupressUIParam(Map params,
boolean suppress)
RedefUtil.EDIT_REQUEST_PARAM_SUPRESS_UI parameter into the parameter map
params - public static boolean isUISuppressed(Map params)
RedefUtil.EDIT_REQUEST_PARAM_SUPRESS_UI parameter
params -
true if the map contains the given parameterpublic RedefinableStructuralFeature[] getRedefinableFeatures()
public static boolean isLocal(Element element,
EObject contextHint)
element - contextHint - is an EObject owned directly or indirectly by the redefinition context (StateMachine or Classifier)
public static Element getRootFragment(Element element)
element -
public static Element getContextualFragment(Element element,
EObject contextHint)
element - contextHint - is an EObject owned directly or indirectly by the redefinition context (StateMachine or Classifier)
public static Element getContextualFragment(RedefUtil.ElementWithRedefinitionContext elementWithContext)
public static Element getLocalFragment(Element element,
EObject contextHint)
public static boolean isInherited(Element element,
EObject contextHint)
element - the Element to check if it is inherited in the context
derived from the viewview - the View that is used to derive the inheritance context
true if the element is inherited, false otherwise.public static StateMachine getContainingStateMachine(EObject eObject)
eObject -
public static Element redefine(Element el,
EObject contextHint)
el - context -
public static Element redefine(RedefUtil.ElementWithRedefinitionContext elementWithContext)
public static void reinherit(Element element)
public static Collection getRedefinitions(Element redefElement)
public static RedefinableElement getRedefinedElement(Element element)
public static Element getReferenceTarget(Element candidate,
EObject contextHint)
candidate - the semantic element that view would "normally" use or its redefinitioncontextHint - is an EObject owned directly or indirectly by the redefinition context (StateMachine or Classifier)
public static IAdaptable getReferenceTarget(IAdaptable candidate,
EObject contextHint)
candidate - the semantic element that view would "normally" use or its redefinitioncontextHint - is an EObject owned directly or indirectly by the redefinition context (StateMachine or Classifier)
public static List getReferencesTargets(Collection candidates,
EObject contextHint)
candidate - the collection of semantic elements that views would "normally" use or their redefinitionscontextHint - is an EObject owned directly or indirectly by the redefinition context (StateMachine or Classifier)public static Classifier getLocalContext(EObject element)
element -
public static Classifier getLocalContextIfExists(EObject element)
element -
public static Classifier getLocalContextFromHint(EObject contextHint)
contextHint -
public static Classifier getLocalContextFromHint(Element element,
EObject contextHint)
element - contextHint -
public static Collection getRedefinitionTree(RedefinableElement element)
element -
public static Object getAdapterForEditPart(Class key,
View view)
public static boolean canReinheritViewTarget(View view)
view -
public static boolean canReinherit(Element element,
EObject contextHint)
element - contextHint -
public static boolean isRedefinitionStructuredFeature(Object sf)
public static EObject getContextHint(Map parameters)
public static List getAllStructuralFeatureContent(Element element,
EObject contextHint,
EStructuralFeature sf)
public static Map getContextHintMap(EObject hint)
public static Collection getSubclasses(Classifier clazz)
public static void removeFragment(Element element)
element -
public static void separate(Element fragment,
boolean absorbInheritedContent)
redefiningFragment - public static void markFragmentRemovalRefactoring(Element element)
public static boolean isFragmentRemovalRefactoring(Element element)
public static void copySharedContent(Element source,
Element target)
public static void copyLocalRedefinableContent(Element source,
Element target)
public static void copyAllRedefinableContent(Element source,
Element target)
public static Element getRedefinedElementOrSuperClass(Element fragment)
public static EReference getRedefinitionStructuralFeature(RedefinableElement el)
public static EObject normalizeContextHint(Element semanticElement,
EObject contextHint)
public static Object getStereotypeValue(Element element,
EObject contextHint,
String stereotypeName,
String valueName)
public static boolean isStereotypeValueInherited(Element element,
EObject contextHint,
String stereotypeName,
String valueName)
public static boolean isStereotypePropertyRedefinable(Stereotype stereotype,
String propertyName)
stereotype - - The stereotype applied to the redefinable elementpropertyName - - The property of the stereotype to be redefined
false if the Stereotype's property has the isLeaf flag set
true otherwisepublic static Collection getInheritanceTree(Classifier clazz)
clazz -
public static boolean isUMLRedefinitionStructuralFeature(EReference sf)
public static Object getValue(EStructuralFeature feature,
Element element,
EObject contextHint)
feature - element - contextHint -
public static boolean isValueLocal(EStructuralFeature feature,
Element element,
EObject contextHint)
feature - element - contextHint -
public static boolean isEventBrokerRedefinitionAware()
public static EStructuralFeature[] getSharedFeatures()
public static boolean canRedefine(Element el,
EObject contextHint)
el - contextHint -
public static boolean isInheritable(Element el,
EObject contextHint)
el - contextHint -
public static boolean canRedefine(RedefUtil.ElementWithRedefinitionContext elementWithContext)
elementWithContext -
public static boolean isRedefinitionContextValid(Classifier elementContext,
Classifier contextHintContext)
elementContext - contextHintContext -
public static void changeRedefinitionRoot(Element newRoot,
Element oldRoot)
newRedefintionRoot - oldRedefinitionRoot -
public static List getInheritedContent(EObject element,
EReference slot)
element - slot -
public static void setRedefinition(Element redefining,
Element redefined)
redefining - redefined - public static boolean isExcluded(Element contextualFragment)
public static boolean isExcluded(Element rootFragment,
EObject redefinitionContextHint)
public static Element unexclude(RedefinableElement contextualFragment)
public static List getAffectedFilesFromContextHint(IEditCommandRequest request)
request -
|
UML Modeling Layer | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||