Class AbstractNodeWithLabels
- java.lang.Object
-
- com._1c.g5.v8.dt.compare.ui.partialmodel.node.AbstractPartialModelNode
-
- com._1c.g5.v8.dt.compare.ui.partialmodel.node.AbstractNodeWithLabels
-
- All Implemented Interfaces:
IComparedElement
,IMergeRulePartialModelNode
,IPartialModelNode
- Direct Known Subclasses:
AbstractNodeWithLabelsAndChildren
,EmfFeatureTerminalNode
,ListElementTerminalNode
public abstract class AbstractNodeWithLabels extends AbstractPartialModelNode implements IMergeRulePartialModelNode
Abstract partial model node with fixed labels and comparison information.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractNodeWithLabels(IPartialModelNode parent, ComparisonNode node, String mainLabel, String otherLabel, IImageProvider imageProvider, IComparisonSession comparisonSession)
Constructs partial node for the specified comparison node.protected
AbstractNodeWithLabels(IPartialModelNode parent, String label, ComparisonSide objectSide, IImageProvider imageProvider, IComparisonSession comparisonSession)
Constructs partial node when the comparison node is absent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChild(IPartialModelNode node)
Adds the specified child node.List<MergeRule>
getAvailableMergeRules()
Returns list of available merge rules.org.eclipse.swt.graphics.Image
getImage()
Returns the node image.String
getLabel()
Returns the node label.MergeRule
getMergeRule()
Returns the merge rule.String
getSideLabel(ComparisonSide side)
Returns a label (textual representation) of the value referred from the specified side of the node.ComparisonNodeStatus
getStatus()
Returns the status of the node in the comparison process.String
getTooltipText()
Returns node's tooltip text.boolean
hasChanged(ComparisonSide side1, ComparisonSide side2)
Returnstrue
if compared objects on the specified sides have changed properties or elements.boolean
hasDifferences(ComparisonSide side1, ComparisonSide side2)
Returnstrue
if compared objects on the specified sides are different, i.e.boolean
hasDoubleChanges()
Returnstrue
if the compared objects have at least one property that was changed from the corresponding property of the common ancestor object both in the main and in the other objects.boolean
hasOnlyOnOneSide(ComparisonSide side1, ComparisonSide side2)
Returnstrue
if the compared object is present on the specified first side, and absent on the specified other side.boolean
hasOrderChanged(ComparisonSide side1, ComparisonSide side2)
Returnstrue
if the compared object's order in its parent collection was changed between the specified sides.boolean
hasPotentialMergeProblems()
Tells whether the compared element has potential problems that could break a project after the merge.boolean
hasUnchanged(ComparisonSide side1, ComparisonSide side2)
Returnstrue
if compared objects on the specified sides have unchanged properties or elements.boolean
isCheckable()
Checks if the node is checkable.boolean
isChecked()
Checks whether this node is checked.boolean
isGrayed()
Checks whether the checkbox of this node is grayed if applicable (i.e.void
setChecked(boolean value)
Sets the "Checked" state of the partial model node.void
setGrayed(boolean value)
void
setMergeRule(MergeRule rule)
Sets the merge rule.void
setShowMergeRule(boolean value)
Sets custom flag of merge rule showing for this node.void
setStatus(ComparisonNodeStatus value)
Sets the status of the node.boolean
showMergeRule()
Checks whether the merge rule should be shown for this node.-
Methods inherited from class com._1c.g5.v8.dt.compare.ui.partialmodel.node.AbstractPartialModelNode
canExpand, check, getChildren, getClosestDirectParent, getComparisonSession, getCustomMergeSettingsStatus, getNodeId, getParent, getSide, getSortedChildren, hasChildren, prioritize, retrieveComparisonNode, setCustomMergeSettingsStatus, setParent
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com._1c.g5.v8.dt.compare.ui.partialmodel.node.IPartialModelNode
canExpand, check, getChildren, getComparisonSession, getCustomMergeSettingsStatus, getNodeId, getParent, getSide, getSortedChildren, hasChildren, prioritize, retrieveComparisonNode, setCustomMergeSettingsStatus, setParent
-
-
-
-
Constructor Detail
-
AbstractNodeWithLabels
protected AbstractNodeWithLabels(IPartialModelNode parent, ComparisonNode node, String mainLabel, String otherLabel, IImageProvider imageProvider, IComparisonSession comparisonSession)
Constructs partial node for the specified comparison node.- Parameters:
parent
- the parent partial model nodenode
- the comparison node to build partial node for, cannot benull
mainLabel
- representation of the main sideotherLabel
- representation of the other sideimageProvider
- the image providercomparisonSession
- the comparison session
-
AbstractNodeWithLabels
protected AbstractNodeWithLabels(IPartialModelNode parent, String label, ComparisonSide objectSide, IImageProvider imageProvider, IComparisonSession comparisonSession)
Constructs partial node when the comparison node is absent. Called to create equal partial nodes, seeIPartialEqualNode
.- Parameters:
parent
- the parent partial model nodelabel
- the object's representationobjectSide
- the object side, can be eithernull
or MAIN or OTHER sideimageProvider
- the image providercomparisonSession
- the comparison session
-
-
Method Detail
-
addChild
public void addChild(IPartialModelNode node)
Description copied from interface:IPartialModelNode
Adds the specified child node.- Specified by:
addChild
in interfaceIPartialModelNode
- Parameters:
node
- the node to add as a child
-
getAvailableMergeRules
public List<MergeRule> getAvailableMergeRules()
Description copied from interface:IMergeRulePartialModelNode
Returns list of available merge rules.- Specified by:
getAvailableMergeRules
in interfaceIMergeRulePartialModelNode
- Returns:
- list of available merge rules
-
getImage
public org.eclipse.swt.graphics.Image getImage()
Description copied from interface:IPartialModelNode
Returns the node image.- Specified by:
getImage
in interfaceIPartialModelNode
- Overrides:
getImage
in classAbstractPartialModelNode
- Returns:
- the node image
-
getLabel
public String getLabel()
Description copied from interface:IPartialModelNode
Returns the node label.- Specified by:
getLabel
in interfaceIPartialModelNode
- Overrides:
getLabel
in classAbstractPartialModelNode
- Returns:
- the node label
-
getMergeRule
public MergeRule getMergeRule()
Description copied from interface:IMergeRulePartialModelNode
Returns the merge rule.- Specified by:
getMergeRule
in interfaceIMergeRulePartialModelNode
- Returns:
- the merge rule
-
getSideLabel
public String getSideLabel(ComparisonSide side)
Description copied from interface:IPartialModelNode
Returns a label (textual representation) of the value referred from the specified side of the node.- Specified by:
getSideLabel
in interfaceIPartialModelNode
- Parameters:
side
- the side of the node- Returns:
- a label
-
getStatus
public ComparisonNodeStatus getStatus()
Description copied from interface:IPartialModelNode
Returns the status of the node in the comparison process.- Specified by:
getStatus
in interfaceIPartialModelNode
- Returns:
- node's current status during comparison
-
hasDifferences
public boolean hasDifferences(ComparisonSide side1, ComparisonSide side2)
Description copied from interface:IComparedElement
Returnstrue
if compared objects on the specified sides are different, i.e. they have changes or one of them is absent.- Specified by:
hasDifferences
in interfaceIComparedElement
- Parameters:
side1
- the first side of the comparison direction, notnull
side2
- the second side of the comparison direction, notnull
- Returns:
true
if the compared objects are different
-
hasChanged
public boolean hasChanged(ComparisonSide side1, ComparisonSide side2)
Description copied from interface:IComparedElement
Returnstrue
if compared objects on the specified sides have changed properties or elements. This implies that the compared objects must be present on both specified sides.- Specified by:
hasChanged
in interfaceIComparedElement
- Parameters:
side1
- the first side of the comparison direction, notnull
side2
- the second side of the comparison direction, notnull
- Returns:
true
if the compared objects have changed properties
-
hasDoubleChanges
public boolean hasDoubleChanges()
Description copied from interface:IComparedElement
Returnstrue
if the compared objects have at least one property that was changed from the corresponding property of the common ancestor object both in the main and in the other objects. This flag is only relevant for three-way nodes.- Specified by:
hasDoubleChanges
in interfaceIComparedElement
- Returns:
true
if the node has properties with double changes or a child node with this flag
-
hasPotentialMergeProblems
public boolean hasPotentialMergeProblems()
Description copied from interface:IComparedElement
Tells whether the compared element has potential problems that could break a project after the merge.- Specified by:
hasPotentialMergeProblems
in interfaceIComparedElement
- Returns:
true
if have potential merge problems,false
otherwise
-
getTooltipText
public String getTooltipText()
Description copied from interface:IPartialModelNode
Returns node's tooltip text.- Specified by:
getTooltipText
in interfaceIPartialModelNode
- Returns:
- the text to be displayed as tooltip or
null
if no tooltip to be displayed
-
hasOnlyOnOneSide
public boolean hasOnlyOnOneSide(ComparisonSide side1, ComparisonSide side2)
Description copied from interface:IComparedElement
Returnstrue
if the compared object is present on the specified first side, and absent on the specified other side.- Specified by:
hasOnlyOnOneSide
in interfaceIComparedElement
- Parameters:
side1
- the first side of the comparison direction, notnull
side2
- the second side of the comparison direction, notnull
- Returns:
true
if the compared object is present onside1
and absent onside2
-
hasOrderChanged
public boolean hasOrderChanged(ComparisonSide side1, ComparisonSide side2)
Description copied from interface:IComparedElement
Returnstrue
if the compared object's order in its parent collection was changed between the specified sides. This implies that the compared objects must be present on both specified sides.- Specified by:
hasOrderChanged
in interfaceIComparedElement
- Parameters:
side1
- the first side of the comparison direction, notnull
side2
- the second side of the comparison direction, notnull
- Returns:
true
if the compared object's order was changed
-
hasUnchanged
public boolean hasUnchanged(ComparisonSide side1, ComparisonSide side2)
Description copied from interface:IComparedElement
Returnstrue
if compared objects on the specified sides have unchanged properties or elements. This implies that the compared objects must be present on both specified sides.- Specified by:
hasUnchanged
in interfaceIComparedElement
- Parameters:
side1
- the first side of the comparison direction, notnull
side2
- the second side of the comparison direction, notnull
- Returns:
true
if the compared objects have changed properties.
-
isCheckable
public boolean isCheckable()
Description copied from interface:IPartialModelNode
Checks if the node is checkable.- Specified by:
isCheckable
in interfaceIPartialModelNode
- Returns:
true
if the node is checkable, andfalse
otherwise
-
isChecked
public boolean isChecked()
Description copied from interface:IPartialModelNode
Checks whether this node is checked.- Specified by:
isChecked
in interfaceIPartialModelNode
- Returns:
true
if the node is checked, andfalse
otherwise
-
isGrayed
public boolean isGrayed()
Description copied from interface:IPartialModelNode
Checks whether the checkbox of this node is grayed if applicable (i.e. it has some children checked and others unchecked). This means that the node has checkable/mergeable children that will not be merged.- Specified by:
isGrayed
in interfaceIPartialModelNode
- Returns:
true
if the node's checkbox is grayed
-
setChecked
public void setChecked(boolean value)
Description copied from interface:IPartialModelNode
Sets the "Checked" state of the partial model node.- Specified by:
setChecked
in interfaceIPartialModelNode
- Parameters:
value
- the value to set
-
setGrayed
public void setGrayed(boolean value)
-
setMergeRule
public void setMergeRule(MergeRule rule)
Description copied from interface:IMergeRulePartialModelNode
Sets the merge rule.- Specified by:
setMergeRule
in interfaceIMergeRulePartialModelNode
- Parameters:
rule
- the merge rule
-
setStatus
public void setStatus(ComparisonNodeStatus value)
Description copied from interface:IPartialModelNode
Sets the status of the node.- Specified by:
setStatus
in interfaceIPartialModelNode
-
showMergeRule
public boolean showMergeRule()
Description copied from interface:IMergeRulePartialModelNode
Checks whether the merge rule should be shown for this node.- Specified by:
showMergeRule
in interfaceIMergeRulePartialModelNode
- Returns:
true
to show merge rule, andfalse
otherwise
-
setShowMergeRule
public void setShowMergeRule(boolean value)
Description copied from interface:IMergeRulePartialModelNode
Sets custom flag of merge rule showing for this node.- Specified by:
setShowMergeRule
in interfaceIMergeRulePartialModelNode
- Parameters:
value
-true
to show merge rule by default,false
to always hide the merge rule
-
-