Class TemplateLangOutlineTreeProvider

  • 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 TemplateLangOutlineTreeProvider
    extends org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider
    customization of the default outline structure.
    • 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.vil.templatelang.templateLang.LanguageUnit unit)
      Creates the Children for LanguageUnit.
      private boolean checkAdviceName​(de.uni_hildesheim.sse.vil.expressions.expressionDsl.Advice advice)
      Checks whether a given advice is not null and has a name.
      private boolean checkCompoundNode​(de.uni_hildesheim.sse.vil.expressions.expressionDsl.Compound typedef)
      Checks whether a given typedef declaration is not null, has a name and a type (name).
      private boolean checkIndentation​(de.uni_hildesheim.sse.vil.templatelang.templateLang.IndentationHintPart indent)
      Checks whether a given indent is not null and has a name and a value.
      private boolean checkParameter​(de.uni_hildesheim.sse.vil.expressions.expressionDsl.Parameter param)
      Checks whether a given parameter is not null, has a name and a type (name).
      private boolean checkTypedefNode​(de.uni_hildesheim.sse.vil.expressions.expressionDsl.TypeDef typedef)
      Checks whether a given typedef declaration is not null, has a name and a type (name).
      private boolean checkVariableDeclaration​(de.uni_hildesheim.sse.vil.expressions.expressionDsl.VariableDeclaration varDecl)
      Checks whether a given variable declaration is not null, has a name and a type (name).
      private void createAdviceNodes​(org.eclipse.emf.common.util.EList<de.uni_hildesheim.sse.vil.expressions.expressionDsl.Advice> adviceList, VirtualOutlineNode parentNode)
      creates a node for every Advice-Statement.
      private void createCompoundNode​(de.uni_hildesheim.sse.vil.expressions.expressionDsl.Compound compound, VirtualOutlineNode parentNode)
      Creates the Compounds.
      private void createDefNode​(de.uni_hildesheim.sse.vil.templatelang.templateLang.VilDef def, org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode)
      Creates the node for 'def' declarations.
      private void createImportNodes​(org.eclipse.emf.common.util.EList<de.uni_hildesheim.sse.vil.expressions.expressionDsl.Import> importList, VirtualOutlineNode parentNode)
      Creates the nodes for the imports.
      private void createIndentNodes​(org.eclipse.emf.common.util.EList<de.uni_hildesheim.sse.vil.templatelang.templateLang.IndentationHintPart> indList, VirtualOutlineNode parentNode)
      Creates the nodes for '@indent'.
      private void createJavaExtNodes​(org.eclipse.emf.common.util.EList<de.uni_hildesheim.sse.vil.templatelang.templateLang.Extension> javExts, VirtualOutlineNode parentNode)
      Creates the nodes for java extensions.
      private void createParameterNodes​(org.eclipse.emf.common.util.EList<de.uni_hildesheim.sse.vil.expressions.expressionDsl.Parameter> paramList, VirtualOutlineNode parentNode)
      Creates the nodes for parameters.
      private void createScriptContentNodes​(org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.EObject> elements, VirtualOutlineNode parentNode)
      Creates the DefDeclarations and the VariableDeclarations.
      private void createTemplateNodes​(de.uni_hildesheim.sse.vil.templatelang.templateLang.LanguageUnit unit, org.eclipse.xtext.ui.editor.outline.impl.DocumentRootNode parentNode)
      Creates all nodes for the template.
      private void createTypdefNode​(de.uni_hildesheim.sse.vil.expressions.expressionDsl.TypeDef typedef, VirtualOutlineNode parentNode)
      Creates the type defs.
      private void createVariableNode​(de.uni_hildesheim.sse.vil.expressions.expressionDsl.VariableDeclaration var, VirtualOutlineNode parentNode)
      Creates the VariableDeclarations.
      private void createVersionNode​(de.uni_hildesheim.sse.vil.expressions.expressionDsl.VersionStmt version, org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode)
      Creates the version node.
      private boolean hasContents​(de.uni_hildesheim.sse.vil.templatelang.templateLang.LanguageUnit templateUnit)
      Checks whether a given template includes variable declarations or sub-template (def) declarations.
      private static boolean isEmpty​(org.eclipse.emf.common.util.EList<?> list)
      Check whether a given EList is null or empty.
      • 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

      • TemplateLangOutlineTreeProvider

        public TemplateLangOutlineTreeProvider()
    • Method Detail

      • _createChildren

        protected void _createChildren​(org.eclipse.xtext.ui.editor.outline.impl.DocumentRootNode parentNode,
                                       de.uni_hildesheim.sse.vil.templatelang.templateLang.LanguageUnit unit)
        Creates the Children for LanguageUnit. It's the rootnode in this case.
        Parameters:
        parentNode - the parent node
        unit - the LanguageUnit
      • createAdviceNodes

        private void createAdviceNodes​(org.eclipse.emf.common.util.EList<de.uni_hildesheim.sse.vil.expressions.expressionDsl.Advice> adviceList,
                                       VirtualOutlineNode parentNode)
        creates a node for every Advice-Statement.
        Parameters:
        adviceList - List with all Advices
        parentNode - parentnode
      • createTemplateNodes

        private void createTemplateNodes​(de.uni_hildesheim.sse.vil.templatelang.templateLang.LanguageUnit unit,
                                         org.eclipse.xtext.ui.editor.outline.impl.DocumentRootNode parentNode)
        Creates all nodes for the template.
        Parameters:
        unit - LanguageUnit with Template
        parentNode - the parent node
      • createScriptContentNodes

        private void createScriptContentNodes​(org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.EObject> elements,
                                              VirtualOutlineNode parentNode)
        Creates the DefDeclarations and the VariableDeclarations.
        Parameters:
        varDecls - the list of variable declarations
        subTemps - the list of su-template declarations
        parentNode - the parent node
      • createDefNode

        private void createDefNode​(de.uni_hildesheim.sse.vil.templatelang.templateLang.VilDef def,
                                   org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode)
        Creates the node for 'def' declarations.
        Parameters:
        def - the 'def' declaration
        parentNode - the parent node
      • createVersionNode

        private void createVersionNode​(de.uni_hildesheim.sse.vil.expressions.expressionDsl.VersionStmt version,
                                       org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode)
        Creates the version node.
        Parameters:
        version - version
        parentNode - version will be displayed under this node
      • createImportNodes

        private void createImportNodes​(org.eclipse.emf.common.util.EList<de.uni_hildesheim.sse.vil.expressions.expressionDsl.Import> importList,
                                       VirtualOutlineNode parentNode)
        Creates the nodes for the imports.
        Parameters:
        importList - List with all imports
        parentNode - all imports will be displayed under this node
      • createJavaExtNodes

        private void createJavaExtNodes​(org.eclipse.emf.common.util.EList<de.uni_hildesheim.sse.vil.templatelang.templateLang.Extension> javExts,
                                        VirtualOutlineNode parentNode)
        Creates the nodes for java extensions.
        Parameters:
        javExts - list with all java extensions
        parentNode - the parent node
      • createParameterNodes

        private void createParameterNodes​(org.eclipse.emf.common.util.EList<de.uni_hildesheim.sse.vil.expressions.expressionDsl.Parameter> paramList,
                                          VirtualOutlineNode parentNode)
        Creates the nodes for parameters.
        Parameters:
        paramList - list with all parameters
        parentNode - the parent node
      • createIndentNodes

        private void createIndentNodes​(org.eclipse.emf.common.util.EList<de.uni_hildesheim.sse.vil.templatelang.templateLang.IndentationHintPart> indList,
                                       VirtualOutlineNode parentNode)
        Creates the nodes for '@indent'.
        Parameters:
        indList - list with all indents
        parentNode - the parent node
      • createTypdefNode

        private void createTypdefNode​(de.uni_hildesheim.sse.vil.expressions.expressionDsl.TypeDef typedef,
                                      VirtualOutlineNode parentNode)
        Creates the type defs.
        Parameters:
        typedef - typedef
        parentNode - all Rules and Variables will be displayed under this node
      • createCompoundNode

        private void createCompoundNode​(de.uni_hildesheim.sse.vil.expressions.expressionDsl.Compound compound,
                                        VirtualOutlineNode parentNode)
        Creates the Compounds.
        Parameters:
        compound - compound
        parentNode - all Rules and Variables will be displayed under this node
      • createVariableNode

        private void createVariableNode​(de.uni_hildesheim.sse.vil.expressions.expressionDsl.VariableDeclaration var,
                                        VirtualOutlineNode parentNode)
        Creates the VariableDeclarations.
        Parameters:
        var - variable
        parentNode - all Rules and Variables will be displayed under this node
      • 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.
      • hasContents

        private boolean hasContents​(de.uni_hildesheim.sse.vil.templatelang.templateLang.LanguageUnit templateUnit)
        Checks whether a given template includes variable declarations or sub-template (def) declarations. This means, the template has an actual content.
        Parameters:
        templateUnit - the language unit to be checked
        Returns:
        True if the template is not null and has either at least one variable declaration or sub-template declaration. False otherwise.
      • checkAdviceName

        private boolean checkAdviceName​(de.uni_hildesheim.sse.vil.expressions.expressionDsl.Advice advice)
        Checks whether a given advice is not null and has a name.
        Parameters:
        advice - the advice to be checked
        Returns:
        True if the advice is not null and has a name. False otherwise.
      • checkIndentation

        private boolean checkIndentation​(de.uni_hildesheim.sse.vil.templatelang.templateLang.IndentationHintPart indent)
        Checks whether a given indent is not null and has a name and a value.
        Parameters:
        indent - the indent to be checked
        Returns:
        True if the indent is completely defined. False otherwise.
      • checkParameter

        private boolean checkParameter​(de.uni_hildesheim.sse.vil.expressions.expressionDsl.Parameter param)
        Checks whether a given parameter is not null, has a name and a type (name).
        Parameters:
        param - the parameter to be checked.
        Returns:
        True if the parameter is completely defined. False otherwise.
      • checkVariableDeclaration

        private boolean checkVariableDeclaration​(de.uni_hildesheim.sse.vil.expressions.expressionDsl.VariableDeclaration varDecl)
        Checks whether a given variable declaration is not null, has a name and a type (name).
        Parameters:
        varDecl - the variable declaration to be checked
        Returns:
        True if the variable declaration is completely defined. False otherwise.
      • checkTypedefNode

        private boolean checkTypedefNode​(de.uni_hildesheim.sse.vil.expressions.expressionDsl.TypeDef typedef)
        Checks whether a given typedef declaration is not null, has a name and a type (name).
        Parameters:
        typedef - the typedef to be checked
        Returns:
        True if the variable declaration is completely defined. False otherwise.
      • checkCompoundNode

        private boolean checkCompoundNode​(de.uni_hildesheim.sse.vil.expressions.expressionDsl.Compound typedef)
        Checks whether a given typedef declaration is not null, has a name and a type (name).
        Parameters:
        typedef - the typedef to be checked
        Returns:
        True if the variable declaration is completely defined. False otherwise.