Package com._1c.g5.v8.dt.compare.ui.util
Class CompareUiUtils
- java.lang.Object
-
- com._1c.g5.v8.dt.compare.ui.util.CompareUiUtils
-
public class CompareUiUtils extends Object
Utility methods of Comparison UI.
-
-
Constructor Summary
Constructors Constructor Description CompareUiUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IPartialFeatureNode
findChildPartialFeatureNode(IPartialModelNode parent, org.eclipse.emf.ecore.EStructuralFeature feature)
Find child partial node related to the given feature.static <T extends FeatureComparisonNode>
TfindComparisonNode(ComparisonNode parent, org.eclipse.emf.ecore.EStructuralFeature feature, IComparisonSession session)
Finds child comparison node with the given feature.static org.eclipse.emf.ecore.EObject
findOtherObject(IPartialModelNode node, ComparisonContext comparisonContext)
Gets OTHER-side model object for the specified partial node.static String
getCommitShortMessage(org.eclipse.jgit.revwalk.RevCommit commit)
Gets shortened commit message.static String
getComparisonSideTitle(ComparisonSide side)
Returns the title of the specified comparison side.static IPartialModelNode
getParentSkippingVirtual(IPartialModelNode node)
Returns partial node's parent skipping virtual ones if they are.static void
syncExec(Runnable runnable)
Synchronously executes given runnable.
-
-
-
Method Detail
-
getComparisonSideTitle
public static String getComparisonSideTitle(ComparisonSide side)
Returns the title of the specified comparison side.- Parameters:
side
- the comparison side, notnull
- Returns:
- 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.- Parameters:
node
- the node to get parent for, cannot benull
- Returns:
- the parent partial node found or
null
-
syncExec
public static void syncExec(Runnable runnable)
Synchronously executes given runnable.- Parameters:
runnable
- the runnable, cannot benull
.
-
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.- Parameters:
node
- the node to get OTHER-side model object for, cannot benull
comparisonContext
- the comparison context, cannot benull
- Returns:
- the OTHER model object found or
null
if no such object
-
findComparisonNode
public static <T extends FeatureComparisonNode> T findComparisonNode(ComparisonNode 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.- Parameters:
parent
- the parent comparison node to search in, cannot benull
feature
- the feature to search the child for, cannot benull
session
- the comparison session, cannot benull
- Returns:
- the child comparison node found or
null
-
findChildPartialFeatureNode
public static IPartialFeatureNode findChildPartialFeatureNode(IPartialModelNode parent, org.eclipse.emf.ecore.EStructuralFeature feature)
Find child partial node related to the given feature.- Parameters:
parent
- the parent partial node to search in, cannot benull
feature
- the feature to search the child for, cannot benull
- Returns:
- the child partial node found or
null
-
getCommitShortMessage
public static String getCommitShortMessage(org.eclipse.jgit.revwalk.RevCommit commit)
Gets shortened commit message.- Parameters:
commit
- commit to get message for, cannot benull
- Returns:
- shortened commit message, never
null
-
-