Class PartialModelController
java.lang.Object
com._1c.g5.v8.dt.compare.ui.partialmodel.PartialModelController
- All Implemented Interfaces:
IManagedService
The partial model controller working with a specified comparison session
and delegating operations to a collection of specific controllers defined in extensions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()check(IPartialModel partialModel, IPartialModelNode node, boolean checked, IComparisonSession comparisonSession) Checks or unchecks a partial model node.voidcompareUsingExternalTool(IPartialModelNode node, org.eclipse.swt.widgets.Shell shell, String mainComparisonSideName, String otherComparisonSideName) Compares the specified node using external tool.voidcreateDirectNodeChildren(IPartialModel partialModel, IDirectPartialModelNode directNode, ILinkRepresentationSupport linkRepresentationSupport, IDtComparisonViewRefresher refresher, ComparisonContext comparisonContext) Creates child nodes for the specified direct node of a partial model.voidvoideditMergeSettings(IPartialModel partialModel, IPartialModelNode node, IComparisonSession comparisonSession, org.eclipse.swt.widgets.Shell shell, boolean readOnly, org.eclipse.swt.graphics.Color colorHasDiffs, org.eclipse.swt.graphics.Color colorOnlyMain, org.eclipse.swt.graphics.Color colorOnlyOther, String mainComparisonSideName, String otherComparisonSideName, DtComparisonView parentComparisonView, ISelectionProviderDelegate selectionProviderDelegate, org.eclipse.jface.resource.ResourceManager resourceManager) Edits merge settings of the specified partial model node in the UI.Gets list of all children together with sub-children of the specified node.Object[]getChildren(Object parentElement, IPartialModel partialModel, ILinkRepresentationSupport linkRepresentationSupport, IDtComparisonViewRefresher refresher, IComparisonSession comparisonSession) Returns the children of the specified parent element.Returns the parent of the specified element.Object[]getTopNodes(IPartialModel partialModel, ILinkRepresentationSupport linkRepresentationSupport, IDtComparisonViewRefresher refresher, ComparisonContext comparisonContext) Gets top nodes for the specified partial model.booleanhasChildren(Object element) Checks whether the specified element has children.voidmergeUsingExternalTool(IPartialModel partialModel, IPartialModelNode node, org.eclipse.swt.widgets.Shell shell, String mainComparisonSideName, String otherComparisonSideName) Merges the specified node using external tool.booleanpositionChildNode(IPartialModel partialModel, IPartialModelNode parentNode, ComparisonNode modelNode, IComparisonSession comparisonSession) Positions the specified comparison model node in a subtree of the specified partial model node.voidrefreshNodes(IPartialModel partialModel, Collection<IPartialModelNode> nodes, IComparisonSession comparisonSession) Refreshes the properties of the specified nodes.voidrefreshNodeWithChildren(IPartialModel partialModel, IPartialModelNode node, IComparisonSession comparisonSession) Refreshes the properties of the specified node and all its children.voidsetMergeRule(IPartialModel partialModel, IMergeRulePartialModelNode node, MergeRule rule, IComparisonSession comparisonSession) Sets the merge rule for the specified partial model node.booleanTells whether the specified node supports comparison using external tool.booleanTells whether the specified node supports merging using external tool.
-
Constructor Details
-
PartialModelController
public PartialModelController()
-
-
Method Details
-
activate
public void activate()- Specified by:
activatein interfaceIManagedService
-
deactivate
public void deactivate()- Specified by:
deactivatein interfaceIManagedService
-
createDirectNodeChildren
public void createDirectNodeChildren(IPartialModel partialModel, IDirectPartialModelNode directNode, ILinkRepresentationSupport linkRepresentationSupport, IDtComparisonViewRefresher refresher, ComparisonContext comparisonContext) Creates child nodes for the specified direct node of a partial model.- Parameters:
partialModel- the partial model, can not benulldirectNode- the direct node, can not benulllinkRepresentationSupport- the link representation support, can not benullrefresher- the refresher, can not benullcomparisonContext- the comparison context, notnull
-
positionChildNode
public boolean positionChildNode(IPartialModel partialModel, IPartialModelNode parentNode, ComparisonNode modelNode, IComparisonSession comparisonSession) Positions the specified comparison model node in a subtree of the specified partial model node. This may involve creation of additional (intermediate) subparents for hosting the positioned node.- Parameters:
partialModel- the partial model, can not benullparentNode- the parent partial model node, can not benullmodelNode- the comparison model node to be positioned, can not benullcomparisonSession- the comparison session, can not benull- Returns:
trueif the node was positioned successfully
-
getTopNodes
public Object[] getTopNodes(IPartialModel partialModel, ILinkRepresentationSupport linkRepresentationSupport, IDtComparisonViewRefresher refresher, ComparisonContext comparisonContext) Gets top nodes for the specified partial model.- Parameters:
partialModel- the partial model to get top nodes for, can not benulllinkRepresentationSupport- the link representation support, can not benullrefresher- the refresher, can not benullcomparisonContext- the comparison context, notnull- Returns:
- an array of top nodes, may be
null
-
editMergeSettings
public void editMergeSettings(IPartialModel partialModel, IPartialModelNode node, IComparisonSession comparisonSession, org.eclipse.swt.widgets.Shell shell, boolean readOnly, org.eclipse.swt.graphics.Color colorHasDiffs, org.eclipse.swt.graphics.Color colorOnlyMain, org.eclipse.swt.graphics.Color colorOnlyOther, String mainComparisonSideName, String otherComparisonSideName, DtComparisonView parentComparisonView, ISelectionProviderDelegate selectionProviderDelegate, org.eclipse.jface.resource.ResourceManager resourceManager) Edits merge settings of the specified partial model node in the UI.- Parameters:
partialModel- the partial model, can not benullnode- the node with merge settings to be edited, can not benullcomparisonSession- the comparison session, can not benullshell- the parent shell, can not benullreadOnly-trueif it is possible to set merge settings andfalseif it is only possible to view the difference in nodecolorHasDiffs- the color for 'node has diffs' case, cannot benull.colorOnlyMain- the color for 'node has only main object' case, cannot benull.colorOnlyOther- the color for 'node has only other object' case, cannot benull.mainComparisonSideName- the main comparison side name, cannot benull.otherComparisonSideName- the other comparison side name, cannot benull.parentComparisonView- the parent comparison view this dialog was called from, cannot benullselectionProviderDelegate- the selection provider delegate, cannot benull.resourceManager- the resource manager, cannot benull
-
refreshNodes
public void refreshNodes(IPartialModel partialModel, Collection<IPartialModelNode> nodes, IComparisonSession comparisonSession) Refreshes the properties of the specified nodes.- Parameters:
partialModel- the partial model, can not benullnodes- the partial nodes to refresh, can not benullcomparisonSession- the comparison session, can not benull
-
refreshNodeWithChildren
public void refreshNodeWithChildren(IPartialModel partialModel, IPartialModelNode node, IComparisonSession comparisonSession) Refreshes the properties of the specified node and all its children.- Parameters:
partialModel- the partial model, can not benullnode- the partial node to refresh, can not benullcomparisonSession- the comparison session, can not benull
-
setMergeRule
public void setMergeRule(IPartialModel partialModel, IMergeRulePartialModelNode node, MergeRule rule, IComparisonSession comparisonSession) Sets the merge rule for the specified partial model node.- Parameters:
partialModel- the partial model, can not benullnode- the node, can not benullrule- the merge rule, can not benullcomparisonSession- the comparison session, can not benull
-
check
public List<IPartialModelNode> check(IPartialModel partialModel, IPartialModelNode node, boolean checked, IComparisonSession comparisonSession) Checks or unchecks a partial model node.- Parameters:
partialModel- the partial model, can not benullnode- the node to modify the "Checked" flag, can not benullchecked- the check valuecomparisonSession- the comparison session, can not benull- Returns:
- list of nodes which state has been possibly updated, never
null
-
getChildren
public Object[] getChildren(Object parentElement, IPartialModel partialModel, ILinkRepresentationSupport linkRepresentationSupport, IDtComparisonViewRefresher refresher, IComparisonSession comparisonSession) Returns the children of the specified parent element.- Parameters:
parentElement- the parent element to get children for, can not benullpartialModel- the partial model, can not benulllinkRepresentationSupport- the link representation support, can not benull'refresher- the refresher, can not benullcomparisonSession- the comparison session, can not benull- Returns:
- an array of children of the parent element or
nullif no children are available
-
getParent
Returns the parent of the specified element.- Parameters:
element- the element to get parent for, can not benull- Returns:
- parent or
null
-
hasChildren
Checks whether the specified element has children.- Parameters:
element- the parent, can not benull- Returns:
trueif the element has children
-
supportsComparisonUsingExternalTool
Tells whether the specified node supports comparison using external tool.- Parameters:
node- the partial model node, cannot benull- Returns:
trueif the specified node supports comparison using external tool,falseotherwise
-
compareUsingExternalTool
public void compareUsingExternalTool(IPartialModelNode node, org.eclipse.swt.widgets.Shell shell, String mainComparisonSideName, String otherComparisonSideName) Compares the specified node using external tool.- Parameters:
node- the partial node to compare using external tool, cannot benullshell- the parent shell, cannot benullmainComparisonSideName- the main comparison side name, cannot benullotherComparisonSideName- the other comparison side name, cannot benull
-
supportsMergingUsingExternalTool
Tells whether the specified node supports merging using external tool.- Parameters:
node- the partial model node, cannot benull- Returns:
trueif the specified node supports merging using external tool,falseotherwise
-
mergeUsingExternalTool
public void mergeUsingExternalTool(IPartialModel partialModel, IPartialModelNode node, org.eclipse.swt.widgets.Shell shell, String mainComparisonSideName, String otherComparisonSideName) Merges the specified node using external tool.- Parameters:
partialModel- the partial model, cannot benullnode- the partial node to merge using external tool, cannot benullshell- the parent shell, cannot benullmainComparisonSideName- the main comparison side name, cannot benullotherComparisonSideName- the other comparison side name, cannot benull
-
getAllChildren
Gets list of all children together with sub-children of the specified node.- Parameters:
node- the node to collect children for, cannot benull- Returns:
- the list of recursively collected children, never
null
-