Class 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 a EStructuralFeature has an IItemPropertyDescriptor.
      static boolean hasFeaturePropertyDescriptor​(org.eclipse.emf.ecore.EStructuralFeature featureToCheck)
      Checks whether a EStructuralFeature has an IItemPropertyDescriptor.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 provided EObject is checked for VView.
        Parameters:
        eObject - the EObject 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 - the EClass to use as root
        childParentReferenceMap - 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 model
        selectedClass - the EClass to get the reference path for
        childParentReferenceMap - 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 a EStructuralFeature has an IItemPropertyDescriptor.
        Parameters:
        featureToCheck - the EStructuralFeature 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 a EStructuralFeature has an IItemPropertyDescriptor.
        Parameters:
        eClass - the root EClass
        treePath - the TreePath to check
        Returns:
        true if a IItemPropertyDescriptor could be found, false otherwise