Class IvmlOutlineTreeProvider

  • All Implemented Interfaces:
    org.eclipse.xtext.ui.editor.outline.impl.IOutlineTreeStructureProvider, org.eclipse.xtext.ui.editor.outline.IOutlineTreeProvider, org.eclipse.xtext.ui.editor.outline.IOutlineTreeProvider.Cancelable

    public class IvmlOutlineTreeProvider
    extends org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider
    Customization of the default outline structure. Methods in here are not directly referenced but called by dynamic invocation. TODO: Know but not fixable problems: typedef(Integer) in IVML-file results in null:Integer in outline -> weil setOf/sequenceOf(XY) genauso "aussieht"!
    Author:
    kroeher (modifications), Dernek
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.eclipse.xtext.ui.editor.outline.IOutlineTreeProvider

        org.eclipse.xtext.ui.editor.outline.IOutlineTreeProvider.Background, org.eclipse.xtext.ui.editor.outline.IOutlineTreeProvider.Cancelable, org.eclipse.xtext.ui.editor.outline.IOutlineTreeProvider.ModeAware
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.eclipse.xtext.ui.IImageHelper imageHelper  
      • Fields inherited from class org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider

        createChildrenDispatcher, createNodeDispatcher, imageDispatcher, isLeafDispatcher, labelProvider, locationInFileProvider, textDispatcher
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void _createChildren​(org.eclipse.xtext.ui.editor.outline.impl.DocumentRootNode parentNode, de.uni_hildesheim.sse.ivml.VariabilityUnit unit)
      Create child-nodes for the document.
      protected void _createChildren​(org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode, de.uni_hildesheim.sse.ivml.Project project)
      Create child-nodes for the project.
      protected boolean _isLeaf​(de.uni_hildesheim.sse.ivml.Eval eval)
      Eval-nodes are always leafs (do not have any children).
      protected boolean _isLeaf​(de.uni_hildesheim.sse.ivml.Project project)
      Make the project-node a leaf (no children) if it does not contain any contents.
      protected boolean _isLeaf​(de.uni_hildesheim.sse.ivml.VariableDeclaration var)
      Variable-declaration-nodes are always leafs (do not have any children).
      private void createAssignNodes​(java.util.List<de.uni_hildesheim.sse.ivml.AttrAssignment> assignList, org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode)
      Create attribute-assignment nodes.
      private void createAttributeNodes​(java.util.List<de.uni_hildesheim.sse.ivml.AnnotateTo> attrList, org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode)
      Create attribute-nodes.
      private void createConflictNodes​(java.util.List<de.uni_hildesheim.sse.ivml.ConflictStmt> conflictList, org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode)
      Create (virtual) main conflict-node which subsumes all conflict-declarations.
      private void createDVNodes​(java.util.List<de.uni_hildesheim.sse.ivml.VariableDeclaration> dvList, org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode)
      Create (virtual) main decision-variable-node which subsumes all decision-variables.
      private void createExpressionNodes​(java.util.List<de.uni_hildesheim.sse.ivml.ExpressionStatement> exprList, org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode)
      Create specific expression-nodes.
      private void createFreezeNodes​(java.util.List<de.uni_hildesheim.sse.ivml.Freeze> freezeList, org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode)
      Create freeze-nodes.
      private void createImportNodes​(java.util.List<de.uni_hildesheim.sse.ivml.ImportStmt> importList, org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode)
      Create (virtual) main import-node which subsumes all import-declarations.
      private void createInterfaceNodes​(java.util.List<de.uni_hildesheim.sse.ivml.InterfaceDeclaration> interfaceList, org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode)
      Create (virtual) main interface-node which subsumes all interface-declarations.
      private void createOpDefStatement​(java.util.List<de.uni_hildesheim.sse.ivml.OpDefStatement> opDefList, org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode)
      Create operation-definition-nodes.
      protected void createProjectContents​(org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode, de.uni_hildesheim.sse.ivml.ProjectContents contents)
      Create child-nodes for project-contents.
      private void createTypeDefNodes​(java.util.List<de.uni_hildesheim.sse.ivml.Typedef> typedefList, org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode)
      Create type-definition-nodes.
      private boolean isEmpty​(de.uni_hildesheim.sse.ivml.AnnotateTo attrStmt)
      Check whether the attribute-statement is empty.
      private boolean isEmpty​(de.uni_hildesheim.sse.ivml.ProjectContents pContents)
      Check whether the given project-contents.
      private boolean isEmpty​(de.uni_hildesheim.sse.ivml.TypedefCompound tdefCompound)
      Check whether the given compound-definition is empty.
      private boolean isEmpty​(de.uni_hildesheim.sse.ivml.TypedefEnum tdefEnum)
      Check whether the given enum-definition is empty.
      private boolean isEmpty​(de.uni_hildesheim.sse.ivml.TypedefMapping tdefMapping)
      Check whether the given type-mapping is empty.
      private boolean isEmpty​(de.uni_hildesheim.sse.ivml.VariableDeclaration varDecl)
      Check whether the given variable-declaration is empty.
      private static boolean isEmpty​(java.util.List<?> list)
      Check whether a given List is null or empty.
      private static boolean isEmpty​(org.eclipse.emf.common.util.EList<?> list)
      Check whether a given EList is null or empty.
      private boolean noNames​(de.uni_hildesheim.sse.ivml.AnnotateTo attrStmt)
      Check whether the attribute-statement has no names (the elements the attribute is assigned to).
      private boolean noRelations​(de.uni_hildesheim.sse.ivml.Project project)
      Check whether the given project does not have any relations.
      • Methods inherited from class org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider

        _createChildren, _createChildren, _createChildren, _createChildren, _createNode, _createNode, _createNode, _image, _isLeaf, _isLeaf, _text, checkCanceled, createChildren, createEObjectNode, createEObjectNode, createEStructuralFeatureNode, createEStructuralFeatureNode, createNode, createRoot, createRoot, isLocalElement, nullSafeClassName, setTextRegion
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • imageHelper

        @Inject
        private org.eclipse.xtext.ui.IImageHelper imageHelper
    • Constructor Detail

      • IvmlOutlineTreeProvider

        public IvmlOutlineTreeProvider()
    • Method Detail

      • _createChildren

        protected void _createChildren​(org.eclipse.xtext.ui.editor.outline.impl.DocumentRootNode parentNode,
                                       de.uni_hildesheim.sse.ivml.VariabilityUnit unit)
        Create child-nodes for the document. This means creating project-nodes.
        Parameters:
        parentNode - The document root node (virtual node, not displayed).
        unit - The top-level element of the IVML-gramar (VariabilityUnit).
      • _createChildren

        protected void _createChildren​(org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode,
                                       de.uni_hildesheim.sse.ivml.Project project)
        Create child-nodes for the project. This means creating version-, import-, conflict-, interface-, and project-contents-nodes if these elements are available in the project.
        Parameters:
        parentNode - The document root node (virtual node, not displayed).
        project - The project.
      • createProjectContents

        protected void createProjectContents​(org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode,
                                             de.uni_hildesheim.sse.ivml.ProjectContents contents)
        Create child-nodes for project-contents. This means creating eval-, expression-, attribute-, attribute-assignment-, freeze-, typedef-, operation-definition-, decision-variable-nodes.
        Parameters:
        parentNode - The project-content-node (virtual node).
        contents - The actual project contents in terms of an IVML-element.
      • _isLeaf

        protected boolean _isLeaf​(de.uni_hildesheim.sse.ivml.Project project)
        Make the project-node a leaf (no children) if it does not contain any contents.
        Parameters:
        project - The project to be checked.
        Returns:
        True if the project has no elements. False otherwise.
      • _isLeaf

        protected boolean _isLeaf​(de.uni_hildesheim.sse.ivml.Eval eval)
        Eval-nodes are always leafs (do not have any children).
        Parameters:
        eval - The eval-node.
        Returns:
        Always true.
      • _isLeaf

        protected boolean _isLeaf​(de.uni_hildesheim.sse.ivml.VariableDeclaration var)
        Variable-declaration-nodes are always leafs (do not have any children).
        Parameters:
        var - The Variable-declaration-node.
        Returns:
        Always true.
      • createInterfaceNodes

        private void createInterfaceNodes​(java.util.List<de.uni_hildesheim.sse.ivml.InterfaceDeclaration> interfaceList,
                                          org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode)
        Create (virtual) main interface-node which subsumes all interface-declarations.
        Parameters:
        interfaceList - The list of interface-declarations of this project.
        parentNode - The parent node of the interface-node (the project-node).
      • createConflictNodes

        private void createConflictNodes​(java.util.List<de.uni_hildesheim.sse.ivml.ConflictStmt> conflictList,
                                         org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode)
        Create (virtual) main conflict-node which subsumes all conflict-declarations.
        Parameters:
        conflictList - The list of conflict-declarations of this project.
        parentNode - The parent node of the conflict-node (the project-node).
      • createImportNodes

        private void createImportNodes​(java.util.List<de.uni_hildesheim.sse.ivml.ImportStmt> importList,
                                       org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode)
        Create (virtual) main import-node which subsumes all import-declarations.
        Parameters:
        importList - The list of import-declarations of this project.
        parentNode - The parent node of the import-node (the project-node).
      • createExpressionNodes

        private void createExpressionNodes​(java.util.List<de.uni_hildesheim.sse.ivml.ExpressionStatement> exprList,
                                           org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode)
        Create specific expression-nodes. This means creating DSL-, let-, and implication-expression nodes. TODO Implication expression nodes are currently not supported!
        Parameters:
        exprList - The list of expression-declarations of this project.
        parentNode - The parent node of the expression-nodes (the project-contents-node).
      • createAttributeNodes

        private void createAttributeNodes​(java.util.List<de.uni_hildesheim.sse.ivml.AnnotateTo> attrList,
                                          org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode)
        Create attribute-nodes.
        Parameters:
        attrList - The list of attribute-declarations of this project.
        parentNode - The parent node of the attribute-nodes (the project-contents-node).
      • createAssignNodes

        private void createAssignNodes​(java.util.List<de.uni_hildesheim.sse.ivml.AttrAssignment> assignList,
                                       org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode)
        Create attribute-assignment nodes.
        Parameters:
        assignList - The list of attribute-assignment-declarations of this project.
        parentNode - The parent node of the attribute-assignment-nodes (the project-contents-node).
      • createFreezeNodes

        private void createFreezeNodes​(java.util.List<de.uni_hildesheim.sse.ivml.Freeze> freezeList,
                                       org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode)
        Create freeze-nodes.
        Parameters:
        freezeList - The list of freeze-declarations of this project.
        parentNode - The parent node of the freeze-nodes (the project-contents-node).
      • createTypeDefNodes

        private void createTypeDefNodes​(java.util.List<de.uni_hildesheim.sse.ivml.Typedef> typedefList,
                                        org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode)
        Create type-definition-nodes. This means creating derived-type-, compound-, and enumeration-nodes.
        Parameters:
        typedefList - The list of type-definitions of this project.
        parentNode - The parent node of the type-definition-nodes (the project-contents-node).
      • createOpDefStatement

        private void createOpDefStatement​(java.util.List<de.uni_hildesheim.sse.ivml.OpDefStatement> opDefList,
                                          org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode)
        Create operation-definition-nodes.
        Parameters:
        opDefList - The list of operation-definitions of this project.
        parentNode - The parent node of the operation-definition-nodes (the project-contents-node).
      • createDVNodes

        private void createDVNodes​(java.util.List<de.uni_hildesheim.sse.ivml.VariableDeclaration> dvList,
                                   org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode)
        Create (virtual) main decision-variable-node which subsumes all decision-variables.
        Parameters:
        dvList - The list of decision-variables of this project.
        parentNode - The parent node of the (virtual) main decision-variable-node which subsumes all decision-variables (the project-contents-node).
      • noRelations

        private boolean noRelations​(de.uni_hildesheim.sse.ivml.Project project)
        Check whether the given project does not have any relations. This means the project does not contain any imports, conflicts, and and interfaces.
        Parameters:
        project - The project to be checked.
        Returns:
        True if the project does not have any relations. False otherwise.
      • isEmpty

        private boolean isEmpty​(de.uni_hildesheim.sse.ivml.ProjectContents pContents)
        Check whether the given project-contents. is empty.
        Parameters:
        pContents - The project-contents to be checked.
        Returns:
        True if the project-contents is empty. False otherwise.
      • isEmpty

        private static boolean isEmpty​(org.eclipse.emf.common.util.EList<?> list)
        Check whether a given EList is null or empty.
        Parameters:
        list - The list to be checked.
        Returns:
        True if the list is null or has no elements. False otherwise.
      • isEmpty

        private static boolean isEmpty​(java.util.List<?> list)
        Check whether a given List is null or empty.
        Parameters:
        list - The list to be checked.
        Returns:
        True if the list is null or has no elements. False otherwise.
      • isEmpty

        private boolean isEmpty​(de.uni_hildesheim.sse.ivml.AnnotateTo attrStmt)
        Check whether the attribute-statement is empty.
        Parameters:
        attrStmt - The attribute-statement to be checked.
        Returns:
        True if the attribute-statement is empty. False otherwise.
      • noNames

        private boolean noNames​(de.uni_hildesheim.sse.ivml.AnnotateTo attrStmt)
        Check whether the attribute-statement has no names (the elements the attribute is assigned to).
        Parameters:
        attrStmt - The attribute-statement to be checked.
        Returns:
        True if the attribute-statement has no names. False otherwise.
      • isEmpty

        private boolean isEmpty​(de.uni_hildesheim.sse.ivml.TypedefMapping tdefMapping)
        Check whether the given type-mapping is empty.
        Parameters:
        tdefMapping - The type-mapping to be checked.
        Returns:
        True if the type-mapping is empty. False otherwise.
      • isEmpty

        private boolean isEmpty​(de.uni_hildesheim.sse.ivml.TypedefCompound tdefCompound)
        Check whether the given compound-definition is empty.
        Parameters:
        tdefCompound - The compound-definition to be checked.
        Returns:
        True if the compound-definition is empty. False otherwise.
      • isEmpty

        private boolean isEmpty​(de.uni_hildesheim.sse.ivml.TypedefEnum tdefEnum)
        Check whether the given enum-definition is empty.
        Parameters:
        tdefEnum - The enum-definition to be checked.
        Returns:
        True if the enum-definition is empty. False otherwise.
      • isEmpty

        private boolean isEmpty​(de.uni_hildesheim.sse.ivml.VariableDeclaration varDecl)
        Check whether the given variable-declaration is empty.
        Parameters:
        varDecl - The variable-declaration to be checked.
        Returns:
        True if the variable-declaration is empty. False otherwise.