Class CompareUiUtils

  • public class CompareUiUtils
    extends Object
    Utility methods of Comparison UI.
    • Constructor Detail

      • CompareUiUtils

        public CompareUiUtils()
    • Method Detail

      • getComparisonSideTitle

        public static String getComparisonSideTitle​(ComparisonSide side)
        Returns the title of the specified comparison side.
        side - the comparison side, not null
        the title of the side, never null
      • getParentSkippingVirtual

        public static IPartialModelNode getParentSkippingVirtual​(IPartialModelNode node)
        Returns partial node's parent skipping virtual ones if they are.
        node - the node to get parent for, cannot be null
        the parent partial node found or null
      • syncExec

        public static void syncExec​(Runnable runnable)
        Synchronously executes given runnable.
        runnable - the runnable, cannot be null.
      • createComparisonContext

        public static ComparisonContext createComparisonContext​(IComparisonSession session,
                                                                boolean writeEnabled)
        Creates instance of a comparison context.
        session - the comparison session to create context for, cannot be null
        writeEnabled - indicates that writing to the comparison model will be allowed
        the comparison context instance, never null
      • findOtherObject

        public static org.eclipse.emf.ecore.EObject findOtherObject​(IPartialModelNode node,
                                                                    ComparisonContext comparisonContext)
        Gets OTHER-side model object for the specified partial node. This method can be used to obtain OTHER object even for equal nodes. It walks from the given node up to the parent that has non-null comparison node and then goes back by OTHER-side model using remembered path.
        node - the node to get OTHER-side model object for, cannot be null
        comparisonContext - the comparison context, cannot be null
        the OTHER model object found or null if no such object
      • findComparisonNode

        public static ContainmentComparisonNode findComparisonNode​(ComparisonTreeNode parent,
                                                                   org.eclipse.emf.ecore.EStructuralFeature feature,
                                                                   IComparisonSession session)
        Finds child comparison node with the given feature. Searches only for containment child nodes skipping all top ones.
        parent - the parent comparison node to search in, cannot be null
        feature - the feature to search the child for, cannot be null
        session - the comparison session, cannot be null
        the child comparison node found or null
      • getCommitShortMessage

        public static String getCommitShortMessage​(org.eclipse.jgit.revwalk.RevCommit commit)
        Gets shortened commit message.
        commit - commit to get message for, cannot be null
        shortened commit message, never null