Class AbstractNodeWithLabelsAndChildren
- java.lang.Object
-
- com._1c.g5.v8.dt.compare.ui.partialmodel.node.AbstractPartialModelNode
-
- com._1c.g5.v8.dt.compare.ui.partialmodel.node.AbstractNodeWithLabels
-
- com._1c.g5.v8.dt.compare.ui.partialmodel.node.AbstractNodeWithLabelsAndChildren
-
- All Implemented Interfaces:
IComparedElement
,IMergeRulePartialModelNode
,IPartialModelNode
- Direct Known Subclasses:
AbstractEqualNodeWithChildren
,EmfFeatureNodeWithChildren
,ListElementNodeWithChildren
public abstract class AbstractNodeWithLabelsAndChildren extends AbstractNodeWithLabels
A partial model node with labels and a list of child nodes.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractNodeWithLabelsAndChildren(IPartialModelNode parent, ComparisonNode comparisonNode, String mainLabel, String otherLabel, IImageProvider imageProvider, IComparisonSession comparisonSession)
Constructs a node for the specified comparison node.protected
AbstractNodeWithLabelsAndChildren(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.boolean
canExpand()
Checks whether this node can be expanded with specific inner content.Collection<IPartialModelNode>
getChildren()
Returns the child nodes.Object[]
getSortedChildren()
Returns an array of children according to this node's logic.boolean
hasChildren()
Checks if the node has child nodes.boolean
isGrayed()
Checks whether the checkbox of this node is grayed if applicable (i.e.void
removeChild(IPartialModelNode child)
Removes the specified child.void
setGrayed(boolean value)
-
Methods inherited from class com._1c.g5.v8.dt.compare.ui.partialmodel.node.AbstractNodeWithLabels
getAvailableMergeRules, getImage, getLabel, getMergeRule, getSideLabel, getStatus, getTooltipText, hasChanged, hasDifferences, hasDoubleChanges, hasOnlyOnOneSide, hasOrderChanged, hasPotentialMergeProblems, hasUnchanged, isCheckable, isChecked, setChecked, setMergeRule, setShowMergeRule, setStatus, showMergeRule
-
Methods inherited from class com._1c.g5.v8.dt.compare.ui.partialmodel.node.AbstractPartialModelNode
check, getClosestDirectParent, getComparisonSession, getCustomMergeSettingsStatus, getNodeId, getParent, getSide, 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
check, getComparisonSession, getCustomMergeSettingsStatus, getNodeId, getParent, getSide, prioritize, retrieveComparisonNode, setCustomMergeSettingsStatus, setParent
-
-
-
-
Constructor Detail
-
AbstractNodeWithLabelsAndChildren
protected AbstractNodeWithLabelsAndChildren(IPartialModelNode parent, ComparisonNode comparisonNode, String mainLabel, String otherLabel, IImageProvider imageProvider, IComparisonSession comparisonSession)
Constructs a node for the specified comparison node.- Parameters:
parent
- the parent partial model nodecomparisonNode
- the comparison node, cannot benull
mainLabel
- representation of the main sideotherLabel
- representation of the other sideimageProvider
- the image providercomparisonSession
- the comparison session
-
AbstractNodeWithLabelsAndChildren
protected AbstractNodeWithLabelsAndChildren(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
-
getChildren
public Collection<IPartialModelNode> getChildren()
Description copied from interface:IPartialModelNode
Returns the child nodes. The order of child nodes is not defined.- Specified by:
getChildren
in interfaceIPartialModelNode
- Overrides:
getChildren
in classAbstractPartialModelNode
- Returns:
- the child nodes
-
hasChildren
public boolean hasChildren()
Description copied from interface:IPartialModelNode
Checks if the node has child nodes.- Specified by:
hasChildren
in interfaceIPartialModelNode
- Overrides:
hasChildren
in classAbstractPartialModelNode
- Returns:
true
if the node has children, andfalse
otherwise
-
getSortedChildren
public Object[] getSortedChildren()
Description copied from interface:IPartialModelNode
Returns an array of children according to this node's logic.- Specified by:
getSortedChildren
in interfaceIPartialModelNode
- Overrides:
getSortedChildren
in classAbstractPartialModelNode
- Returns:
- a sorted array of child nodes
-
addChild
public void addChild(IPartialModelNode node)
Description copied from interface:IPartialModelNode
Adds the specified child node.- Specified by:
addChild
in interfaceIPartialModelNode
- Overrides:
addChild
in classAbstractNodeWithLabels
- Parameters:
node
- the node to add as a child
-
removeChild
public void removeChild(IPartialModelNode child)
Removes the specified child. This is a low-level method and it may only be called by the partial model owner.- Parameters:
child
- the child to remove
-
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
- Overrides:
isGrayed
in classAbstractNodeWithLabels
- Returns:
true
if the node's checkbox is grayed
-
setGrayed
public void setGrayed(boolean value)
- Overrides:
setGrayed
in classAbstractNodeWithLabels
-
canExpand
public boolean canExpand()
Description copied from interface:IPartialModelNode
Checks whether this node can be expanded with specific inner content.- Specified by:
canExpand
in interfaceIPartialModelNode
- Overrides:
canExpand
in classAbstractPartialModelNode
- Returns:
true
if the node can be expanded with inner elements
-
-