Class AbstractEmfBasedPartialModelController

    • Field Detail

      • 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 Detail

      • AbstractEmfBasedPartialModelController

        public AbstractEmfBasedPartialModelController​(ISymbolicLinkLocalizer symbolicLinkLocalizer)
        Constructor.
        Parameters:
        symbolicLinkLocalizer - the symbolic link localizer, can not be null
    • Method Detail

      • 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,
                                                         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)
      • 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
      • 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
      • isSupported

        protected abstract boolean isSupported​(ComparisonNode node)
      • 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