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 Details

    • scopeProvider

      protected org.eclipse.xtext.scoping.IScopeProvider scopeProvider
      The scope provider that may be used by the controller for symbolic link resolving.
    • symbolicLinkLocalizer

      protected final ISymbolicLinkLocalizer symbolicLinkLocalizer
      The symbolic link localizer
  • Constructor Details

    • AbstractEmfBasedPartialModelController

      public AbstractEmfBasedPartialModelController(ISymbolicLinkLocalizer symbolicLinkLocalizer)
      Constructor.
      Parameters:
      symbolicLinkLocalizer - the symbolic link localizer, can not be null
  • 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 interface IPartialModelControllerDelegate
      Parameters:
      partialModel - the partial model
      partialModelNode - the node of the partial model
      comparisonSession - the comparison session
      linkRepresentationSupport - the link respresentation support
      comparisonContext - the comparison context, not null
      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

      protected abstract String getSingleValueRepresentation(Object value)
    • localizeSymbolicLink

      protected abstract String localizeSymbolicLink(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EStructuralFeature feature, String symlink)
    • getSymlink

      protected String getSymlink(IComparisonDataSource dataSource, org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference, Object value)
    • getBooleanRepresentation

      protected String getBooleanRepresentation(boolean value)
    • 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

      protected void registerInnerElementSuppliers(Consumer<IInnerElementSupplier> collector)
      Gets the collection of registered inner elements suppliers used to form the customized nodes of the partial model.
      Parameters:
      collector - Supplier collector.
    • createEqualNodesObjectsCollector

      protected EqualNodesObjectsCollector 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

      protected IImageProvider getImageProvider(org.eclipse.emf.ecore.EStructuralFeature feature)
      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

      protected abstract boolean isSupported(ComparisonNode node)
    • 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, not null
      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 be null
      comparedParentObjects - the triple of compared parent objects, cannot be null
      feature - the feature to check, cannot be null
      session - the comparison session, cannot be null
      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 be null
      feature - the feature to check, cannot be null
      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 be null
      Returns:
      true if terminal node required, false if with children one required
    • isExpandableNodeRequired

      protected boolean isExpandableNodeRequired(Object object)
      Checks whether we need to build an expandable partial node with children for the specified object.
      Parameters:
      object - the object to check, can be null
      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 selected EObject and EStructuralFeature
      Parameters:
      eObject - the EObject, can be null
      feature - the EStructuralFeature, cannot be null
      Returns:
      the value object, can be null