Class AbstractPartialModelNodeWithChildren
- java.lang.Object
-
- com._1c.g5.v8.dt.compare.ui.partialmodel.node.AbstractPartialModelNode
-
- com._1c.g5.v8.dt.compare.ui.partialmodel.node.AbstractPartialModelNodeWithChildren
-
- All Implemented Interfaces:
IComparedElement
,IPartialModelNode
- Direct Known Subclasses:
AbstractDirectPartialModelNode
,VirtualFolderPartialModelNode
public abstract class AbstractPartialModelNodeWithChildren extends AbstractPartialModelNode
An abstract partial model node with child nodes and a status.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractPartialModelNodeWithChildren(ComparisonNode comparisonNode, IComparisonSession comparisonSession)
Constructs a node without a parent.protected
AbstractPartialModelNodeWithChildren(IPartialModelNode parent, ComparisonNode comparisonNode, IComparisonSession comparisonSession)
Constructs a node.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addChild(IPartialModelNode node)
Adds the specified child node.protected abstract List<org.eclipse.emf.ecore.EReference>
getChildFeaturesOrderDefiningList()
Returns an order-defining list of features this node may contain as sub-nodes.Collection<IPartialModelNode>
getChildren()
Returns the child nodes.String
getLabel()
Returns the node label.Object[]
getSortedChildren()
Returns an array of children according to this node's logic.ComparisonNodeStatus
getStatus()
Returns the status of the node in the comparison process.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 grayed)
Sets the "grayed" value of the nodevoid
setStatus(ComparisonNodeStatus status)
Sets the status of the node.VirtualFolderPartialModelNode
to(IPartialModel partialModel, VirtualFolderDescriptor virtualFolderDescriptor)
Returns a child virtual folder node with the specified descriptor.AbstractPartialModelNodeWithChildren
to(IPartialModel partialModel, VirtualFolderDescriptor... descriptors)
Returns a partial model node corresponding to the specified path defined by an array of descriptors, starting from this node.-
Methods inherited from class com._1c.g5.v8.dt.compare.ui.partialmodel.node.AbstractPartialModelNode
canExpand, check, getClosestDirectParent, getComparisonSession, getCustomMergeSettingsStatus, getImage, 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.model.IComparedElement
hasChanged, hasDifferences, hasDoubleChanges, hasOnlyOnOneSide, hasOrderChanged, hasPotentialMergeProblems, hasUnchanged
-
Methods inherited from interface com._1c.g5.v8.dt.compare.ui.partialmodel.node.IPartialModelNode
getSideLabel, getTooltipText, isCheckable, isChecked, setChecked
-
-
-
-
Constructor Detail
-
AbstractPartialModelNodeWithChildren
protected AbstractPartialModelNodeWithChildren(IPartialModelNode parent, ComparisonNode comparisonNode, IComparisonSession comparisonSession)
Constructs a node.- Parameters:
parent
- the parent of the constructed node, may benull
comparisonNode
- the model node, may benull
comparisonSession
- the comparison session
-
AbstractPartialModelNodeWithChildren
protected AbstractPartialModelNodeWithChildren(ComparisonNode comparisonNode, IComparisonSession comparisonSession)
Constructs a node without a parent.- Parameters:
comparisonNode
- the model node, may benull
comparisonSession
- 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
-
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
-
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.- 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
-
to
public VirtualFolderPartialModelNode to(IPartialModel partialModel, VirtualFolderDescriptor virtualFolderDescriptor)
Returns a child virtual folder node with the specified descriptor. In case of absence creates one.- Parameters:
partialModel
- the partial model, notnull
virtualFolderDescriptor
- the descriptor, notnull
- Returns:
- a child virtual folder partial model, not
null
-
to
public AbstractPartialModelNodeWithChildren to(IPartialModel partialModel, VirtualFolderDescriptor... descriptors)
Returns a partial model node corresponding to the specified path defined by an array of descriptors, starting from this node. In case of absence of nodes on the path, creates them.- Parameters:
partialModel
- the partial model, notnull
descriptors
- the array of descriptors defining the path, notnull
- Returns:
- the node defined by the path
-
getStatus
public ComparisonNodeStatus getStatus()
Description copied from interface:IPartialModelNode
Returns the status of the node in the comparison process.- Returns:
- node's current status during comparison
-
setStatus
public void setStatus(ComparisonNodeStatus status)
Sets the status of the node.- Parameters:
status
- the status to set
-
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.- Returns:
true
if the node's checkbox is grayed
-
setGrayed
public void setGrayed(boolean grayed)
Sets the "grayed" value of the node- Parameters:
grayed
- the "grayed" value
-
getChildFeaturesOrderDefiningList
protected abstract List<org.eclipse.emf.ecore.EReference> getChildFeaturesOrderDefiningList()
Returns an order-defining list of features this node may contain as sub-nodes.- Returns:
- the list of features in the correct order, may be empty, never
null
-
-