Class PartialModelController
- java.lang.Object
-
- com._1c.g5.v8.dt.compare.ui.partialmodel.PartialModelController
-
- All Implemented Interfaces:
IManagedService
public class PartialModelController extends Object implements 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 Constructor Description PartialModelController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activate()
List<IPartialModelNode>
check(IPartialModel partialModel, IPartialModelNode node, boolean checked, IComparisonSession comparisonSession)
Checks or unchecks a partial model node.void
compareUsingExternalTool(IPartialModelNode node, org.eclipse.swt.widgets.Shell shell, String mainComparisonSideName, String otherComparisonSideName)
Compares the specified node using external tool.void
createDirectNodeChildren(IPartialModel partialModel, IDirectPartialModelNode directNode, ILinkRepresentationSupport linkRepresentationSupport, IDtComparisonViewRefresher refresher, ComparisonContext comparisonContext)
Creates child nodes for the specified direct node of a partial model.void
deactivate()
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.List<IPartialModelNode>
getAllChildren(IPartialModelNode node)
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.Object
getParent(Object 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.boolean
hasChildren(Object element)
Checks whether the specified element has children.void
mergeUsingExternalTool(IPartialModel partialModel, IPartialModelNode node, org.eclipse.swt.widgets.Shell shell, String mainComparisonSideName, String otherComparisonSideName)
Merges the specified node using external tool.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.void
refreshNodes(IPartialModel partialModel, Collection<IPartialModelNode> nodes, IComparisonSession comparisonSession)
Refreshes the properties of the specified nodes.void
refreshNodeWithChildren(IPartialModel partialModel, IPartialModelNode node, IComparisonSession comparisonSession)
Refreshes the properties of the specified node and all its children.void
setMergeRule(IPartialModel partialModel, IMergeRulePartialModelNode node, MergeRule rule, IComparisonSession comparisonSession)
Sets the merge rule for the specified partial model node.boolean
supportsComparisonUsingExternalTool(IPartialModelNode node)
Tells whether the specified node supports comparison using external tool.boolean
supportsMergingUsingExternalTool(IPartialModelNode node)
Tells whether the specified node supports merging using external tool.
-
-
-
Method Detail
-
activate
public void activate()
- Specified by:
activate
in interfaceIManagedService
-
deactivate
public void deactivate()
- Specified by:
deactivate
in 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 benull
directNode
- the direct node, can not benull
linkRepresentationSupport
- the link representation support, can not benull
refresher
- the refresher, can not benull
comparisonContext
- 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 benull
parentNode
- the parent partial model node, can not benull
modelNode
- the comparison model node to be positioned, can not benull
comparisonSession
- the comparison session, can not benull
- Returns:
true
if 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 benull
linkRepresentationSupport
- the link representation support, can not benull
refresher
- the refresher, can not benull
comparisonContext
- 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 benull
node
- the node with merge settings to be edited, can not benull
comparisonSession
- the comparison session, can not benull
shell
- the parent shell, can not benull
readOnly
-true
if it is possible to set merge settings andfalse
if 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 benull
selectionProviderDelegate
- 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 benull
nodes
- the partial nodes to refresh, can not benull
comparisonSession
- 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 benull
node
- the partial node to refresh, can not benull
comparisonSession
- 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 benull
node
- the node, can not benull
rule
- the merge rule, can not benull
comparisonSession
- 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 benull
node
- the node to modify the "Checked" flag, can not benull
checked
- 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 benull
partialModel
- the partial model, can not benull
linkRepresentationSupport
- the link representation support, can not benull
'refresher
- the refresher, can not benull
comparisonSession
- the comparison session, can not benull
- Returns:
- an array of children of the parent element or
null
if no children are available
-
getParent
public Object getParent(Object element)
Returns the parent of the specified element.- Parameters:
element
- the element to get parent for, can not benull
- Returns:
- parent or
null
-
hasChildren
public boolean hasChildren(Object element)
Checks whether the specified element has children.- Parameters:
element
- the parent, can not benull
- Returns:
true
if the element has children
-
supportsComparisonUsingExternalTool
public boolean supportsComparisonUsingExternalTool(IPartialModelNode node)
Tells whether the specified node supports comparison using external tool.- Parameters:
node
- the partial model node, cannot benull
- Returns:
true
if the specified node supports comparison using external tool,false
otherwise
-
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 benull
shell
- the parent shell, cannot benull
mainComparisonSideName
- the main comparison side name, cannot benull
otherComparisonSideName
- the other comparison side name, cannot benull
-
supportsMergingUsingExternalTool
public boolean supportsMergingUsingExternalTool(IPartialModelNode node)
Tells whether the specified node supports merging using external tool.- Parameters:
node
- the partial model node, cannot benull
- Returns:
true
if the specified node supports merging using external tool,false
otherwise
-
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 benull
node
- the partial node to merge using external tool, cannot benull
shell
- the parent shell, cannot benull
mainComparisonSideName
- the main comparison side name, cannot benull
otherComparisonSideName
- the other comparison side name, cannot benull
-
getAllChildren
public List<IPartialModelNode> getAllChildren(IPartialModelNode node)
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
-
-