Class XdtoUiUtil


  • public class XdtoUiUtil
    extends Object
    Xdto Ui util.
    • Constructor Detail

      • XdtoUiUtil

        public XdtoUiUtil()
    • Method Detail

      • canPastToTarget

        public static boolean canPastToTarget​(Object target)
        Checks if can past copied objects to target.
        Parameters:
        target - the target to insertion, cannot be null
        Returns:
        true if can copy or false if insertion disabled
      • createModel

        public static IModel createModel​(org.eclipse.emf.ecore.EObject object,
                                         org.eclipse.emf.ecore.EStructuralFeature feature)
        Creates IModel instance by the given arguments.
        Parameters:
        object - the EObject instance, cannot be null
        feature - the EStructuralFeature instance, cannot be null
        Returns:
        a newly created model.
      • getCopiedObjects

        public static Object[] getCopiedObjects​(org.eclipse.swt.widgets.Display display)
        Returns copied objects from clipboard if present.
        Parameters:
        display - the display, can be null
        Returns:
        the copied objects from the clipboard or null if no data of this type is available
      • getInsertionPoint

        public static IMdObjectCopyTarget getInsertionPoint​(ISelection selection,
                                                            Object[] copiedObjects)
        Returns insertion point.
        Parameters:
        selection - the current selection, cannot be null
        copiedObjects - the copied objects, cannot be null
        Returns:
        the copy target, can be null if copied empty or insertion disabled
      • getPackageTreeElements

        public static List<Package> getPackageTreeElements​(Object inputElement)
        Returns package tree elenemts.
        Parameters:
        inputElement - the package or list packages, cannot be null
        Returns:
        the elements list packages or empty list, never null
      • getPackageTreeNodeChildren

        public static List<?> getPackageTreeNodeChildren​(Object parentNode)
        Returns package tree node children.
        Parameters:
        parentNode - the package tree parent node, cannot be null
        Returns:
        child list or empty list, never null
      • getParent

        public static Object getParent​(Object treeNode)
        Returns package tree node parent.
        Parameters:
        treeNode - the package tree node, cannot be null
        Returns:
        parent node or null
      • getPresentationName

        public static String getPresentationName​(QName qname)
        Gets UI presentation of QName: "localName (nsUri)"
        Parameters:
        qname - actual QName for getting UI presentation, cannot be null
        Returns:
        UI presentation of QName, never null
      • isNonBmObject

        public static boolean isNonBmObject​(org.eclipse.emf.ecore.EObject eObject)
        Checks that selected e-object is non bm-object, because it contained in the plain e-object.
        Parameters:
        eObject - the checked e-object, cannot be null
        Returns:
        true if e-object contained in the plain e-object
      • setEObjectName

        public static void setEObjectName​(org.eclipse.emf.ecore.EObject eObject,
                                          org.eclipse.emf.ecore.EStructuralFeature eFeature,
                                          org.eclipse.emf.ecore.EObject eContainer)
        Sets new package child object name.
        Parameters:
        eClass - the target object e-class, cannot be null
        eContainer - the target object container, cannot be null
        eFeature - , the target object container feature, cannot be null