Class AbstractEmfBasedPartialModelController
java.lang.Object
com._1c.g5.v8.dt.compare.ui.partialmodel.AbstractEmfBasedPartialModelController
- All Implemented Interfaces:
IPartialModelControllerDelegate
- Direct Known Subclasses:
AbstractMdAwarePartialModelController
public abstract class AbstractEmfBasedPartialModelController
extends Object
implements IPartialModelControllerDelegate
A specific partial model controller for EMF-based model elements.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.eclipse.xtext.scoping.IScopeProvider
The scope provider that may be used by the controller for symbolic link resolving.protected final ISymbolicLinkLocalizer
The symbolic link localizer -
Constructor Summary
ConstructorsConstructorDescriptionAbstractEmfBasedPartialModelController
(ISymbolicLinkLocalizer symbolicLinkLocalizer) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addFeatures
(IPartialModel partialModel, AbstractPartialModelNode node, IComparisonSession session, ILinkRepresentationSupport linkRepresentationSupport, Collection<IPartialModelNode> output, ComparisonContext comparisonContext) protected IPartialEqualFeatureNode
createEqualFeatureNode
(IPartialModelNode parent, AbstractComparedEmfObjects<?> comparedParentObjects, org.eclipse.emf.ecore.EStructuralFeature feature, String mainLabel, String otherLabel, IImageProvider imageProvider, IComparisonSession session, ComparisonContext comparisonContext) Creates equal partial node for the feature.protected EqualNodesObjectsCollector
Creates a collector to collect child objects to create equal nodes for.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.createInnerElements
(IPartialModel partialModel, IPartialModelNode partialModelNode, IComparisonSession comparisonSession, ILinkRepresentationSupport linkRepresentationSupport, ComparisonContext comparisonContext) Creates inner elements for the specified partial model node.protected void
createInnerElements
(AbstractNodeWithLabelsAndChildren forNode, IComparisonSession comparisonSession, IPartialModel partialModel, ILinkRepresentationSupport linkRepresentationSupport, Collection<IPartialModelNode> output, ComparisonContext comparisonContext) protected String
getBooleanRepresentation
(boolean value) protected List<IPartialFeatureNode>
getChildrenFeatureNodes
(IPartialModel partialModel, AbstractPartialModelNode node, IComparisonSession session, ILinkRepresentationSupport linkRepresentationSupport, Collection<IPartialModelNode> output, ComparisonContext comparisonContext) protected List<IPartialModelNode>
getChildrenListNodes
(IPartialModel partialModel, IPartialFeatureNode forNode, IComparisonSession session, ComparisonContext comparisonContext) protected Object
getEObjectValue
(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EStructuralFeature feature) Returns the valid value object for selectedEObject
andEStructuralFeature
protected IImageProvider
getImageProvider
(org.eclipse.emf.ecore.EStructuralFeature feature) Returns the image provider for the given feature.protected IImageProvider
getListElementImageProvider
(IComparedObjects<?> comparedObjects, IComparisonSession session) protected String
getRepresentation
(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, IComparisonSession session, ComparisonSide side) protected String
getSingleRepresentation
(IComparisonDataSource dataSource, org.eclipse.emf.ecore.EObject context, Object value, org.eclipse.emf.ecore.EStructuralFeature feature) protected abstract String
protected String
getSymlink
(IComparisonDataSource dataSource, org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference, Object value) protected abstract String
getValueRepresentation
(IComparisonDataSource dataSource, org.eclipse.emf.ecore.EObject object, Object value, org.eclipse.emf.ecore.EStructuralFeature feature) protected boolean
isExpandableEqualNodeRequired
(AbstractComparedEmfObjects<?> comparedParentObjects, org.eclipse.emf.ecore.EStructuralFeature feature) Checks whether we need to build an expandable partial node with children for the equal node.protected boolean
isExpandableFeatureNodeRequired
(ComparisonNode node, AbstractComparedEmfObjects<?> comparedParentObjects, org.eclipse.emf.ecore.EStructuralFeature feature, IComparisonSession session) Checks whether we need to build an expandable partial node with children for the feature node.protected boolean
isExpandableNodeRequired
(Object object) Checks whether we need to build an expandable partial node with children for the specified object.protected abstract boolean
isSupported
(ComparisonNode node) protected boolean
isTerminalNodeFeature
(org.eclipse.emf.ecore.EStructuralFeature feature) Checks whether we need to build an terminal node for feature.protected abstract String
localizeSymbolicLink
(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EStructuralFeature feature, String symlink) protected void
Gets the collection of registered inner elements suppliers used to form the customized nodes of the partial model.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.ui.partialmodel.IPartialModelControllerDelegate
compareUsingExternalTool, editMergeSettings, fillNodeProperties, getTopNodes, mergeUsingExternalTool, positionChildNode, refreshNode, setMergeRule, supportsComparisonUsingExternalTool, supportsMergingUsingExternalTool
-
Field Details
-
scopeProvider
protected org.eclipse.xtext.scoping.IScopeProvider scopeProviderThe scope provider that may be used by the controller for symbolic link resolving. -
symbolicLinkLocalizer
The symbolic link localizer
-
-
Constructor Details
-
AbstractEmfBasedPartialModelController
Constructor.- Parameters:
symbolicLinkLocalizer
- the symbolic link localizer, can not benull
-
-
Method Details
-
createInnerElements
public Collection<IPartialModelNode> createInnerElements(IPartialModel partialModel, IPartialModelNode partialModelNode, IComparisonSession comparisonSession, ILinkRepresentationSupport linkRepresentationSupport, ComparisonContext comparisonContext) Description copied from interface:IPartialModelControllerDelegate
Creates inner elements for the specified partial model node.- Specified by:
createInnerElements
in interfaceIPartialModelControllerDelegate
- Parameters:
partialModel
- the partial modelpartialModelNode
- the node of the partial modelcomparisonSession
- the comparison sessionlinkRepresentationSupport
- the link respresentation supportcomparisonContext
- the comparison context, notnull
- Returns:
true
if this controller supported the operation for the provided arguments
-
getRepresentation
protected String getRepresentation(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, IComparisonSession session, ComparisonSide side) -
getSingleRepresentation
protected String getSingleRepresentation(IComparisonDataSource dataSource, org.eclipse.emf.ecore.EObject context, Object value, org.eclipse.emf.ecore.EStructuralFeature feature) -
getValueRepresentation
protected abstract String getValueRepresentation(IComparisonDataSource dataSource, org.eclipse.emf.ecore.EObject object, Object value, org.eclipse.emf.ecore.EStructuralFeature feature) -
getSingleValueRepresentation
-
localizeSymbolicLink
-
getSymlink
protected String getSymlink(IComparisonDataSource dataSource, org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference, Object value) -
getBooleanRepresentation
-
addFeatures
protected void addFeatures(IPartialModel partialModel, AbstractPartialModelNode node, IComparisonSession session, ILinkRepresentationSupport linkRepresentationSupport, Collection<IPartialModelNode> output, ComparisonContext comparisonContext) -
getChildrenFeatureNodes
protected List<IPartialFeatureNode> getChildrenFeatureNodes(IPartialModel partialModel, AbstractPartialModelNode node, IComparisonSession session, ILinkRepresentationSupport linkRepresentationSupport, Collection<IPartialModelNode> output, ComparisonContext comparisonContext) -
registerInnerElementSuppliers
Gets the collection of registered inner elements suppliers used to form the customized nodes of the partial model.- Parameters:
collector
- Supplier collector.
-
createEqualNodesObjectsCollector
Creates a collector to collect child objects to create equal nodes for. Descendants may provide own implementation.- Returns:
- the collector instance, never
null
-
getChildrenListNodes
protected List<IPartialModelNode> getChildrenListNodes(IPartialModel partialModel, IPartialFeatureNode forNode, IComparisonSession session, ComparisonContext comparisonContext) -
getImageProvider
Returns the image provider for the given feature.- Parameters:
feature
- the feature to get the image provider for- Returns:
- the image provider
-
getListElementImageProvider
protected IImageProvider getListElementImageProvider(IComparedObjects<?> comparedObjects, IComparisonSession session) -
isSupported
-
createInnerElements
protected void createInnerElements(AbstractNodeWithLabelsAndChildren forNode, IComparisonSession comparisonSession, IPartialModel partialModel, ILinkRepresentationSupport linkRepresentationSupport, Collection<IPartialModelNode> output, ComparisonContext comparisonContext) -
createEqualFeatureNode
protected IPartialEqualFeatureNode createEqualFeatureNode(IPartialModelNode parent, AbstractComparedEmfObjects<?> comparedParentObjects, org.eclipse.emf.ecore.EStructuralFeature feature, String mainLabel, String otherLabel, IImageProvider imageProvider, IComparisonSession session, ComparisonContext comparisonContext) Creates equal partial node for the feature.- Parameters:
parent
- the parent node.comparedParentObjects
- the parent node compared objects.feature
- the feature.mainLabel
- the representation of the main side.otherLabel
- the representation of the other side.imageProvider
- the image provider.session
- the comparison session.comparisonContext
- the comparison context.- Returns:
- the created node, never
null
.
-
createFeatureNode
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.- 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
.
-
isExpandableFeatureNodeRequired
protected boolean isExpandableFeatureNodeRequired(ComparisonNode node, AbstractComparedEmfObjects<?> comparedParentObjects, org.eclipse.emf.ecore.EStructuralFeature feature, IComparisonSession session) Checks whether we need to build an expandable partial node with children for the feature node.- Parameters:
the
- comparison node to check, cannot benull
comparedParentObjects
- the triple of compared parent objects, cannot benull
feature
- the feature to check, cannot benull
session
- the comparison session, cannot benull
- Returns:
true
if expandable node with children required,false
if terminal one required
-
isExpandableEqualNodeRequired
protected boolean isExpandableEqualNodeRequired(AbstractComparedEmfObjects<?> comparedParentObjects, org.eclipse.emf.ecore.EStructuralFeature feature) Checks whether we need to build an expandable partial node with children for the equal node.- Parameters:
comparedParentObjects
- the triple of compared parent objects, cannot benull
feature
- the feature to check, cannot benull
- Returns:
true
if expandable node with children required,false
if terminal one required
-
isTerminalNodeFeature
protected boolean isTerminalNodeFeature(org.eclipse.emf.ecore.EStructuralFeature feature) Checks whether we need to build an terminal node for feature.- Parameters:
feature
- the feature to check, cannot benull
- Returns:
true
if terminal node required,false
if with children one required
-
isExpandableNodeRequired
Checks whether we need to build an expandable partial node with children for the specified object.- Parameters:
object
- the object to check, can benull
- Returns:
true
if expandable node with children required,false
if terminal one required
-
getEObjectValue
protected Object getEObjectValue(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EStructuralFeature feature) Returns the valid value object for selectedEObject
andEStructuralFeature
- Parameters:
eObject
- theEObject
, can benull
feature
- theEStructuralFeature
, cannot benull
- Returns:
- the value object, can be
null
-