Class RightsPartialModelController
- java.lang.Object
-
- com._1c.g5.v8.dt.compare.ui.partialmodel.AbstractEmfBasedPartialModelController
-
- com._1c.g5.v8.dt.md.compare.ui.AbstractMdAwarePartialModelController
-
- com._1c.g5.v8.dt.rights.compare.ui.RightsPartialModelController
-
- All Implemented Interfaces:
IPartialModelControllerDelegate
public class RightsPartialModelController extends AbstractMdAwarePartialModelController
Partial model controller for role's rights.
-
-
Field Summary
-
Fields inherited from class com._1c.g5.v8.dt.compare.ui.partialmodel.AbstractEmfBasedPartialModelController
scopeProvider, symbolicLinkLocalizer
-
-
Constructor Summary
Constructors Constructor Description RightsPartialModelController(ISymbolicLinkLocalizer symbolicLinkLocalizer, IBmRightsIndexManager bmRightsIndexManager, org.eclipse.xtext.naming.IQualifiedNameProvider qualifiedNameProvider, IResourceLookup resourceLookup, IModelObjectTreeSearchEngine searchEngine, IBmModelManager bmModelManager, IBmEmfIndexManager bmEmfIndexManager, IIndexSlicePredicateService slicePredicateService, IFilterBySubsystemsManager filterBySubsystemsManager, IDtProjectManager dtProjectManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
compareUsingExternalTool(IPartialModelNode node, org.eclipse.swt.widgets.Shell shell, String mainComparisonSideName, String otherComparisonSideName)
Compares the specified node using external tool if the node is supported.protected IPartialFeatureNode
createFeatureNode(IPartialModelNode parent, AbstractComparedEmfObjects<?> comparedParentObjects, ComparisonNode comparisonNode, org.eclipse.emf.ecore.EStructuralFeature feature, String mainLabel, String otherLabel, IComparisonSession session, ComparisonContext comparisonContext)
Creates the node for feature.boolean
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)
If the node is supported, handles the editing of the specified node's merge settings.Collection<IPartialModelNode>
fillNodeProperties(IPartialModel partialModel, IDirectPartialModelNode directNode, IComparisonSession session, ILinkRepresentationSupport linkRepresentationSupport, ComparisonContext comparisonContext)
Fills properties of the specified direct partial model node according to the comparison model node.protected List<IPartialFeatureNode>
getChildrenFeatureNodes(IPartialModel partialModel, AbstractPartialModelNode node, IComparisonSession session, ILinkRepresentationSupport linkRepresentationSupport, Collection<IPartialModelNode> output, ComparisonContext comparisonContext)
protected String
getSingleRepresentation(IComparisonDataSource dataSource, org.eclipse.emf.ecore.EObject context, Object value, org.eclipse.emf.ecore.EStructuralFeature feature)
IPartialModelNode[]
getTopNodes(IPartialModel partialModel)
Returns a sorted array of top nodes of the specified partial model.protected boolean
isSupported(ComparisonNode node)
boolean
mergeUsingExternalTool(IPartialModel partialModel, IPartialModelNode node, org.eclipse.swt.widgets.Shell shell, String mainComparisonSideName, String otherComparisonSideName)
Merges the specified node using external tool if the node is supported.IPartialModelNode
positionChildNode(IPartialModel partialModel, IPartialModelNode parentNode, ComparisonNode modelNode, IComparisonSession comparisonSession)
If supported by this controller, positions the specified comparison model node in a subtree of the specified partial model node.boolean
refreshNode(IPartialModel partialModel, IPartialModelNode node, IComparisonSession comparisonSession)
Refreshes the partial model node properties according to the supported logic.protected void
registerInnerElementSuppliers(Consumer<IInnerElementSupplier> collector)
Gets the collection of registered inner elements suppliers used to form the customized nodes of the partial model.boolean
setMergeRule(IPartialModel partialModel, IComparisonSession comparisonSession, IMergeRulePartialModelNode originalNode, MergeRule rule, ComparisonContext comparisonContext)
Handles the merge rule change.boolean
supportsComparisonUsingExternalTool(IPartialModelNode node)
Tells whether the delegate supports comparison using external tool of the specified node.boolean
supportsMergingUsingExternalTool(IPartialModelNode node)
Tells whether the delegate supports merging using external tool of the specified node.-
Methods inherited from class com._1c.g5.v8.dt.md.compare.ui.AbstractMdAwarePartialModelController
forEObject, getLocalizedStringMapRepresentation, getSingleValueRepresentation, getTypeRepresentation, getValueRepresentation, localizeSymbolicLink
-
Methods inherited from class com._1c.g5.v8.dt.compare.ui.partialmodel.AbstractEmfBasedPartialModelController
addFeatures, createEqualFeatureNode, createEqualNodesObjectsCollector, createInnerElements, createInnerElements, getBooleanRepresentation, getChildrenListNodes, getImageProvider, getListElementImageProvider, getRepresentation, getSymlink, isExpandableEqualNodeRequired, isExpandableFeatureNodeRequired, isExpandableNodeRequired, isTerminalNodeFeature
-
-
-
-
Constructor Detail
-
RightsPartialModelController
@Inject public RightsPartialModelController(ISymbolicLinkLocalizer symbolicLinkLocalizer, IBmRightsIndexManager bmRightsIndexManager, org.eclipse.xtext.naming.IQualifiedNameProvider qualifiedNameProvider, IResourceLookup resourceLookup, IModelObjectTreeSearchEngine searchEngine, IBmModelManager bmModelManager, IBmEmfIndexManager bmEmfIndexManager, IIndexSlicePredicateService slicePredicateService, IFilterBySubsystemsManager filterBySubsystemsManager, IDtProjectManager dtProjectManager)
-
-
Method Detail
-
editMergeSettings
public boolean 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)
Description copied from interface:IPartialModelControllerDelegate
If the node is supported, handles the editing of the specified node's merge settings.- Parameters:
partialModel
- the partial modelnode
- the node to edit merge settings ofcomparisonSession
- the comparison sessionshell
- 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
- Returns:
true
if the node's merge settings have been successfully edited
-
fillNodeProperties
public Collection<IPartialModelNode> fillNodeProperties(IPartialModel partialModel, IDirectPartialModelNode directNode, IComparisonSession session, ILinkRepresentationSupport linkRepresentationSupport, ComparisonContext comparisonContext)
Description copied from interface:IPartialModelControllerDelegate
Fills properties of the specified direct partial model node according to the comparison model node.- Parameters:
partialModel
- the partial model hosting the direct nodedirectNode
- the direct node to fill properties forsession
- the comparison sessioncomparisonContext
- the comparison context, notnull
- Returns:
null
if this controller does not support the input partial model node, or a collection of output nodes whose properties must be filled by the caller (may be empty)
-
getTopNodes
public IPartialModelNode[] getTopNodes(IPartialModel partialModel)
Description copied from interface:IPartialModelControllerDelegate
Returns a sorted array of top nodes of the specified partial model.- Parameters:
partialModel
- the partial model- Returns:
- a sorted array of top nodes
-
positionChildNode
public IPartialModelNode positionChildNode(IPartialModel partialModel, IPartialModelNode parentNode, ComparisonNode modelNode, IComparisonSession comparisonSession)
Description copied from interface:IPartialModelControllerDelegate
If supported by this controller, 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 modelparentNode
- the parent direct partial model nodemodelNode
- the comparison model node to be positionedcomparisonSession
- the comparison session- Returns:
- the positioned partial model node or
null
if this controller does not support the specified model node
-
refreshNode
public boolean refreshNode(IPartialModel partialModel, IPartialModelNode node, IComparisonSession comparisonSession)
Description copied from interface:IPartialModelControllerDelegate
Refreshes the partial model node properties according to the supported logic.- Parameters:
partialModel
- the partial modelnode
- the partial model node to refreshcomparisonSession
- the comparison session- Returns:
true
if the controller supports this node
-
setMergeRule
public boolean setMergeRule(IPartialModel partialModel, IComparisonSession comparisonSession, IMergeRulePartialModelNode originalNode, MergeRule rule, ComparisonContext comparisonContext)
Description copied from interface:IPartialModelControllerDelegate
Handles the merge rule change.- Parameters:
partialModel
- the partial modelcomparisonSession
- the comparison sessionoriginalNode
- the node in which the rule has been setrule
- the rule value that has been setcomparisonContext
- the comparison context, notnull
- Returns:
true
if this controller supported the operation for the provided arguments
-
supportsComparisonUsingExternalTool
public boolean supportsComparisonUsingExternalTool(IPartialModelNode node)
Description copied from interface:IPartialModelControllerDelegate
Tells whether the delegate supports comparison using external tool of the specified node.- Parameters:
node
- the partial mode node, cannot benull
- Returns:
true
if the delegate supports comparison using external tool,false
otherwise
-
compareUsingExternalTool
public boolean compareUsingExternalTool(IPartialModelNode node, org.eclipse.swt.widgets.Shell shell, String mainComparisonSideName, String otherComparisonSideName)
Description copied from interface:IPartialModelControllerDelegate
Compares the specified node using external tool if the node is supported.- 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
- Returns:
true
if the node is supported to be compared using external tool,false
otherwise
-
supportsMergingUsingExternalTool
public boolean supportsMergingUsingExternalTool(IPartialModelNode node)
Description copied from interface:IPartialModelControllerDelegate
Tells whether the delegate supports merging using external tool of the specified node.- Parameters:
node
- the partial mode node, cannot benull
- Returns:
true
if the delegate supports merging using external tool,false
otherwise
-
mergeUsingExternalTool
public boolean mergeUsingExternalTool(IPartialModel partialModel, IPartialModelNode node, org.eclipse.swt.widgets.Shell shell, String mainComparisonSideName, String otherComparisonSideName)
Description copied from interface:IPartialModelControllerDelegate
Merges the specified node using external tool if the node is supported.- 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
- Returns:
true
if the node is supported to be merged using external tool,false
otherwise
-
createFeatureNode
protected IPartialFeatureNode createFeatureNode(IPartialModelNode parent, AbstractComparedEmfObjects<?> comparedParentObjects, ComparisonNode comparisonNode, org.eclipse.emf.ecore.EStructuralFeature feature, String mainLabel, String otherLabel, IComparisonSession session, ComparisonContext comparisonContext)
Description copied from class:AbstractEmfBasedPartialModelController
Creates the node for feature.- Overrides:
createFeatureNode
in classAbstractEmfBasedPartialModelController
- Parameters:
parent
- the parent node.comparedParentObjects
- the parent node compared objects.comparisonNode
- the related comparison node.feature
- the feature.mainLabel
- the main label.otherLabel
- the other label.session
- the comparison session.comparisonContext
- the comparison context, notnull
- Returns:
- the created node, never
null
.
-
getChildrenFeatureNodes
protected List<IPartialFeatureNode> getChildrenFeatureNodes(IPartialModel partialModel, AbstractPartialModelNode node, IComparisonSession session, ILinkRepresentationSupport linkRepresentationSupport, Collection<IPartialModelNode> output, ComparisonContext comparisonContext)
- Overrides:
getChildrenFeatureNodes
in classAbstractEmfBasedPartialModelController
-
getSingleRepresentation
protected String getSingleRepresentation(IComparisonDataSource dataSource, org.eclipse.emf.ecore.EObject context, Object value, org.eclipse.emf.ecore.EStructuralFeature feature)
- Overrides:
getSingleRepresentation
in classAbstractMdAwarePartialModelController
-
isSupported
protected boolean isSupported(ComparisonNode node)
- Specified by:
isSupported
in classAbstractEmfBasedPartialModelController
-
registerInnerElementSuppliers
protected void registerInnerElementSuppliers(Consumer<IInnerElementSupplier> collector)
Description copied from class:AbstractEmfBasedPartialModelController
Gets the collection of registered inner elements suppliers used to form the customized nodes of the partial model.- Overrides:
registerInnerElementSuppliers
in classAbstractMdAwarePartialModelController
- Parameters:
collector
- Supplier collector.
-
-