Class AbstractPartialModelNode
- java.lang.Object
-
- com._1c.g5.v8.dt.compare.ui.partialmodel.node.AbstractPartialModelNode
-
- All Implemented Interfaces:
IComparedElement
,IPartialModelNode
- Direct Known Subclasses:
AbstractNodeWithLabels
,AbstractPartialModelNodeWithChildren
,RootPartialModelNode
public abstract class AbstractPartialModelNode extends Object implements IPartialModelNode
An abstract partial model without children.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractPartialModelNode(ComparisonNode comparisonNode, IComparisonSession comparisonSession)
Constructs a node without a parent.protected
AbstractPartialModelNode(IPartialModelNode parent, ComparisonNode comparisonNode, IComparisonSession comparisonSession)
Constructs a node with the specified parent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canExpand()
Checks whether this node can be expanded with specific inner content.void
check(boolean checked)
Checks the node.Collection<IPartialModelNode>
getChildren()
Returns the child nodes.IDirectPartialModelNode
getClosestDirectParent()
Returns the closest parent node which is a direct node.IComparisonSession
getComparisonSession()
Gets the comparison session associated with this partial node.CustomMergeSettingsStatus
getCustomMergeSettingsStatus()
Returns the custom merge settings status of this node.org.eclipse.swt.graphics.Image
getImage()
Returns the node image.String
getLabel()
Returns the node label.long
getNodeId()
Gets BM id of a comparison node associated with this UI partial node.IPartialModelNode
getParent()
Returns the parent node.ComparisonSide
getSide()
If the compared object presents only on MAIN or on OTHER side and is absent on the other one, that side is returned.Object[]
getSortedChildren()
Returns an array of children according to this node's logic.boolean
hasChildren()
Checks if the node has child nodes.void
prioritize()
Prioritize the node comparison in the specified session.ComparisonNode
retrieveComparisonNode()
Retrieves the corresponding comparison model node.void
setCustomMergeSettingsStatus(CustomMergeSettingsStatus customMergeSettingsStatus)
Sets the custom merge settings status to the node.IPartialModelNode
setParent(IPartialModel partialModel, IPartialModelNode parent)
Sets the specified parent and includes this in the list of its children.-
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
addChild, getSideLabel, getStatus, getTooltipText, isCheckable, isChecked, isGrayed, setChecked, setStatus
-
-
-
-
Constructor Detail
-
AbstractPartialModelNode
protected AbstractPartialModelNode(IPartialModelNode parent, ComparisonNode comparisonNode, IComparisonSession comparisonSession)
Constructs a node with the specified parent.- Parameters:
parent
- the parent of the constructed node, may benull
comparisonNode
- the comparison node this node will be based on, may benull
comparisonSession
- the comparison session
-
AbstractPartialModelNode
protected AbstractPartialModelNode(ComparisonNode comparisonNode, IComparisonSession comparisonSession)
Constructs a node without a parent.- Parameters:
comparisonNode
- the comparison node this node will be based on, may benull
comparisonSession
- the comparison session
-
-
Method Detail
-
getNodeId
public long getNodeId()
Description copied from interface:IPartialModelNode
Gets BM id of a comparison node associated with this UI partial node.- Specified by:
getNodeId
in interfaceIPartialModelNode
- Returns:
- the BM id or -1 if no comparison node associated
-
getParent
public IPartialModelNode getParent()
Description copied from interface:IPartialModelNode
Returns the parent node.- Specified by:
getParent
in interfaceIPartialModelNode
- Returns:
- the parent node
-
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
- 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
- Returns:
true
if the node has children, andfalse
otherwise
-
getImage
public org.eclipse.swt.graphics.Image getImage()
Description copied from interface:IPartialModelNode
Returns the node image.- Specified by:
getImage
in interfaceIPartialModelNode
- Returns:
- the node image
-
getLabel
public String getLabel()
Description copied from interface:IPartialModelNode
Returns the node label.- Specified by:
getLabel
in interfaceIPartialModelNode
- 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
- Returns:
- a sorted array of child nodes
-
setParent
public IPartialModelNode setParent(IPartialModel partialModel, IPartialModelNode parent)
Sets the specified parent and includes this in the list of its children.- Specified by:
setParent
in interfaceIPartialModelNode
- Parameters:
partialModel
- the partial modelparent
- the parent node- Returns:
- this
-
getSide
public ComparisonSide getSide()
Description copied from interface:IPartialModelNode
If the compared object presents only on MAIN or on OTHER side and is absent on the other one, that side is returned.- Specified by:
getSide
in interfaceIPartialModelNode
- Returns:
- the MAIN or OTHER side or
null
if the compared object presents on both sides
-
check
public void check(boolean checked)
Description copied from interface:IPartialModelNode
Checks the node. It changes node's state in the model and sets corresponding flag in the partial model node.- Specified by:
check
in interfaceIPartialModelNode
- Parameters:
checked
-true
to check,false
to uncheck
-
getClosestDirectParent
public IDirectPartialModelNode getClosestDirectParent()
Returns the closest parent node which is a direct node.- Returns:
- the closest direct parent node or
null
if there is no such node
-
prioritize
public void prioritize()
Description copied from interface:IPartialModelNode
Prioritize the node comparison in the specified session.- Specified by:
prioritize
in interfaceIPartialModelNode
-
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
- Returns:
true
if the node can be expanded with inner elements
-
getCustomMergeSettingsStatus
public CustomMergeSettingsStatus getCustomMergeSettingsStatus()
Description copied from interface:IPartialModelNode
Returns the custom merge settings status of this node.- Specified by:
getCustomMergeSettingsStatus
in interfaceIPartialModelNode
- Returns:
- the custom merge settings status, never
null
-
setCustomMergeSettingsStatus
public void setCustomMergeSettingsStatus(CustomMergeSettingsStatus customMergeSettingsStatus)
Description copied from interface:IPartialModelNode
Sets the custom merge settings status to the node.- Specified by:
setCustomMergeSettingsStatus
in interfaceIPartialModelNode
- Parameters:
customMergeSettingsStatus
- the status to set, can not benull
-
getComparisonSession
public IComparisonSession getComparisonSession()
Description copied from interface:IPartialModelNode
Gets the comparison session associated with this partial node.- Specified by:
getComparisonSession
in interfaceIPartialModelNode
- Returns:
- the comparison session or
null
if no associated session
-
retrieveComparisonNode
public ComparisonNode retrieveComparisonNode()
Description copied from interface:IPartialModelNode
Retrieves the corresponding comparison model node.- Specified by:
retrieveComparisonNode
in interfaceIPartialModelNode
- Returns:
- the comparison model node or
null
if no comparison node associated
-
-