Class Helper
- java.lang.Object
-
- org.eclipse.emf.ecp.view.spi.editor.controls.Helper
-
public final class Helper extends java.lang.Object
Helper class for editor controls.- Since:
- 1.5
- Author:
- Eugen Neufeld
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Set<org.eclipse.emf.ecore.EClass>
getDatasegmentSubclasses(org.eclipse.emf.ecore.EClass root)
Determines all EClasses that can be reached from this EClass.static void
getReferenceMap(org.eclipse.emf.ecore.EClass parent, java.util.Map<org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EReference> childParentReferenceMap)
Fills a map based on all containment features found from the provided EClass onward.static java.util.List<org.eclipse.emf.ecore.EReference>
getReferencePath(org.eclipse.emf.ecore.EClass rootEClass, org.eclipse.emf.ecore.EClass selectedClass, java.util.Map<org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EReference> childParentReferenceMap)
Retrieves the reference path for a selected EClass from the provided map.static org.eclipse.emf.ecore.EClass
getRootEClass(org.eclipse.emf.ecore.EObject eObject)
Retrieves the root ECLass form an EObject.static boolean
hasFeaturePropertyDescriptor(org.eclipse.emf.ecore.EClass eClass, org.eclipse.jface.viewers.TreePath treePath)
Checks whether aEStructuralFeature
has anIItemPropertyDescriptor
.static boolean
hasFeaturePropertyDescriptor(org.eclipse.emf.ecore.EStructuralFeature featureToCheck)
Checks whether aEStructuralFeature
has anIItemPropertyDescriptor
.
-
-
-
Method Detail
-
getRootEClass
public static org.eclipse.emf.ecore.EClass getRootEClass(org.eclipse.emf.ecore.EObject eObject)
Retrieves the root ECLass form an EObject. The hierarchy of the providedEObject
is checked forVView
.- Parameters:
eObject
- theEObject
to check- Returns:
- the root
EClass
-
getReferenceMap
public static void getReferenceMap(org.eclipse.emf.ecore.EClass parent, java.util.Map<org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EReference> childParentReferenceMap)
Fills a map based on all containment features found from the provided EClass onward.- Parameters:
parent
- theEClass
to use as rootchildParentReferenceMap
- the map to fill
-
getReferencePath
public static java.util.List<org.eclipse.emf.ecore.EReference> getReferencePath(org.eclipse.emf.ecore.EClass rootEClass, org.eclipse.emf.ecore.EClass selectedClass, java.util.Map<org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EReference> childParentReferenceMap)
Retrieves the reference path for a selected EClass from the provided map.- Parameters:
rootEClass
- the root EClass of the view modelselectedClass
- theEClass
to get the reference path forchildParentReferenceMap
- the map to use- Returns:
- the reference path
-
getDatasegmentSubclasses
public static java.util.Set<org.eclipse.emf.ecore.EClass> getDatasegmentSubclasses(org.eclipse.emf.ecore.EClass root)
Determines all EClasses that can be reached from this EClass.- Parameters:
root
- the EClass to analyze- Returns:
- the Set of ECLasses which can be references from this control
-
hasFeaturePropertyDescriptor
public static boolean hasFeaturePropertyDescriptor(org.eclipse.emf.ecore.EStructuralFeature featureToCheck)
Checks whether aEStructuralFeature
has anIItemPropertyDescriptor
.- Parameters:
featureToCheck
- theEStructuralFeature
to check- Returns:
- true if a IItemPropertyDescriptor could be found, false otherwise
-
hasFeaturePropertyDescriptor
public static boolean hasFeaturePropertyDescriptor(org.eclipse.emf.ecore.EClass eClass, org.eclipse.jface.viewers.TreePath treePath)
Checks whether aEStructuralFeature
has anIItemPropertyDescriptor
.- Parameters:
eClass
- the rootEClass
treePath
- theTreePath
to check- Returns:
- true if a IItemPropertyDescriptor could be found, false otherwise
-
-