Class TemplateLangProposalProviderUtility


  • public class TemplateLangProposalProviderUtility
    extends java.lang.Object
    A utility class for determining different elements in the VTL build model based on the more generic information provided by the Xtext UI functionalities (typically EObject, etc.)
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private de.uni_hildesheim.sse.vil.templatelang.templateLang.impl.VilDefImpl findDefDeclaration​(org.eclipse.xtext.nodemodel.INode node)
      finds the VilDefImpl object inside of a statement.
      java.util.List<org.eclipse.jface.viewers.StyledString> getAllDefs​(org.eclipse.xtext.nodemodel.INode node)
      Returns all def-Declarations inside of the VTL-Script, ready to display as a propose.
      java.util.List<org.eclipse.jface.viewers.StyledString> getAllParamsFromDef​(org.eclipse.xtext.nodemodel.INode node)
      Returns all parameters from a def-Declaration, ready to display as a propose.
      java.util.List<org.eclipse.jface.viewers.StyledString> getAllParamsFromTemplate​(org.eclipse.xtext.nodemodel.INode node)
      Returns all parameters from the VTL-Template, ready to display as a propose.
      java.util.List<java.lang.String> getAllRegisteredTypes​(org.eclipse.xtext.nodemodel.INode node)
      Returns all VTL-types currently available in EASy-Producer.
      private java.util.List<java.lang.String> getAllTypes​(org.eclipse.xtext.nodemodel.INode node)
      Returns all VTL-types currently available in EASy-Producer, but may contain duplicate entries.
      java.util.List<org.eclipse.jface.viewers.StyledString> getAllVarsInLangUnit​(org.eclipse.xtext.nodemodel.INode node)
      Returns all variables inside of the LanguageUnit, ready to display as a proposal.
      java.util.List<org.eclipse.jface.viewers.StyledString> getAllVarsInLangUnitWithType​(org.eclipse.xtext.nodemodel.INode node, java.util.List<java.lang.String> typeList)  
      java.util.List<org.eclipse.jface.viewers.StyledString> getAllVarsInStmt​(org.eclipse.xtext.nodemodel.INode node)
      Returns all variables inside of a statement, ready to display as a proposal.
      java.util.List<org.eclipse.jface.viewers.StyledString> getAllVarsInStmtWithType​(org.eclipse.xtext.nodemodel.INode node, java.util.List<java.lang.String> typeList)
      Returns all variables inside of a statement, which have a specific type, ready to display as a proposal.
      private java.util.List<de.uni_hildesheim.sse.vil.templatelang.templateLang.VilDef> getDefs​(org.eclipse.xtext.nodemodel.INode node)
      Returns a list with all def-Declarations inside of an VTL-Script.
      private org.eclipse.emf.common.util.EList<de.uni_hildesheim.sse.vil.expressions.expressionDsl.Parameter> getParamsFromDef​(org.eclipse.xtext.nodemodel.INode node)
      Returns a list with all parameters the def-Declaration have.
      private org.eclipse.emf.common.util.EList<de.uni_hildesheim.sse.vil.expressions.expressionDsl.Parameter> getParamsFromTemplate​(org.eclipse.xtext.nodemodel.INode node)
      Returns a list with all parameters the template have.
      private java.util.List<de.uni_hildesheim.sse.vil.expressions.expressionDsl.VariableDeclaration> getVarsInLangUnit​(org.eclipse.xtext.nodemodel.INode node)
      Returns a list with all VariableDeclaration inside of the LanguageUnit.
      private java.util.List<de.uni_hildesheim.sse.vil.expressions.expressionDsl.VariableDeclaration> getVarsInStmt​(org.eclipse.xtext.nodemodel.INode node)
      Returns a list with all VariableDeclaration inside of a statement and all from tiers above.
      private java.util.List<de.uni_hildesheim.sse.vil.expressions.expressionDsl.VariableDeclaration> getVarsInStmtWithType​(org.eclipse.xtext.nodemodel.INode node, java.util.List<java.lang.String> typeList)  
      • Methods inherited from class java.lang.Object

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

      • TemplateLangProposalProviderUtility

        public TemplateLangProposalProviderUtility()
        prevents external creation.
    • Method Detail

      • getAllVarsInStmt

        public java.util.List<org.eclipse.jface.viewers.StyledString> getAllVarsInStmt​(org.eclipse.xtext.nodemodel.INode node)
        Returns all variables inside of a statement, ready to display as a proposal.
        Parameters:
        node - the last complete node, when the content-assist is used.
        Returns:
        List with all variables, to show as a proposal. Maybe null, if no variables were found.
      • getAllVarsInStmtWithType

        public java.util.List<org.eclipse.jface.viewers.StyledString> getAllVarsInStmtWithType​(org.eclipse.xtext.nodemodel.INode node,
                                                                                               java.util.List<java.lang.String> typeList)
        Returns all variables inside of a statement, which have a specific type, ready to display as a proposal.
        Parameters:
        node - the last complete node, when the content-assist is used.
        the - list List with the specific types.
        Returns:
        List with all variables, to show as a proposal. Maybe null, if no variables were found.
      • getAllVarsInLangUnit

        public java.util.List<org.eclipse.jface.viewers.StyledString> getAllVarsInLangUnit​(org.eclipse.xtext.nodemodel.INode node)
        Returns all variables inside of the LanguageUnit, ready to display as a proposal.
        Parameters:
        node - the last complete node, when the content-assist is used.
        Returns:
        List with all variables, to show as a proposal. Maybe null, if no variables were found.
      • getAllVarsInLangUnitWithType

        public java.util.List<org.eclipse.jface.viewers.StyledString> getAllVarsInLangUnitWithType​(org.eclipse.xtext.nodemodel.INode node,
                                                                                                   java.util.List<java.lang.String> typeList)
      • getAllDefs

        public java.util.List<org.eclipse.jface.viewers.StyledString> getAllDefs​(org.eclipse.xtext.nodemodel.INode node)
        Returns all def-Declarations inside of the VTL-Script, ready to display as a propose. This method should only be used inside of a def-declaration, because proposing the defs outside of the declaration makes no sense. The method removes automatically the def-declaration in which the method is used.
        Parameters:
        node - the last complete node.
        Returns:
        List with all def-Declarations. Maybe null, if no defs were found.
      • getAllParamsFromDef

        public java.util.List<org.eclipse.jface.viewers.StyledString> getAllParamsFromDef​(org.eclipse.xtext.nodemodel.INode node)
        Returns all parameters from a def-Declaration, ready to display as a propose. This method should only be called inside of a def-Declaration.
        Parameters:
        node - the last complete node.
        Returns:
        List with all parameters. Maybe null, if no parameters were found.
      • getAllParamsFromTemplate

        public java.util.List<org.eclipse.jface.viewers.StyledString> getAllParamsFromTemplate​(org.eclipse.xtext.nodemodel.INode node)
        Returns all parameters from the VTL-Template, ready to display as a propose.
        Parameters:
        node - the last complete node.
        Returns:
        List with all parameters. Maybe null, if no parameters were found.
      • getAllRegisteredTypes

        public java.util.List<java.lang.String> getAllRegisteredTypes​(org.eclipse.xtext.nodemodel.INode node)
        Returns all VTL-types currently available in EASy-Producer.
        Parameters:
        node - the INode object (last complete node) for which the content assist is called.
        Returns:
        a list of the names (String) of all types currently registered to EASy-Producer.
      • getAllTypes

        private java.util.List<java.lang.String> getAllTypes​(org.eclipse.xtext.nodemodel.INode node)
        Returns all VTL-types currently available in EASy-Producer, but may contain duplicate entries.
        Parameters:
        node - the INode object (last complete node) for which the content assist is called.
        Returns:
        a list of the names (String) of all types currently registered to EASy-Producer.
      • getVarsInStmtWithType

        private java.util.List<de.uni_hildesheim.sse.vil.expressions.expressionDsl.VariableDeclaration> getVarsInStmtWithType​(org.eclipse.xtext.nodemodel.INode node,
                                                                                                                              java.util.List<java.lang.String> typeList)
      • getVarsInStmt

        private java.util.List<de.uni_hildesheim.sse.vil.expressions.expressionDsl.VariableDeclaration> getVarsInStmt​(org.eclipse.xtext.nodemodel.INode node)
        Returns a list with all VariableDeclaration inside of a statement and all from tiers above.
        Parameters:
        node - the last complete node, when the content-assist is used.
        Returns:
        a list with all VariableDeclarations. Maybe null, if no variables were found.
      • getVarsInLangUnit

        private java.util.List<de.uni_hildesheim.sse.vil.expressions.expressionDsl.VariableDeclaration> getVarsInLangUnit​(org.eclipse.xtext.nodemodel.INode node)
        Returns a list with all VariableDeclaration inside of the LanguageUnit. This means all variables, which aren't in defs for example.
        Parameters:
        node - the last complete node, when the content-assist is used.
        Returns:
        a list with all VariableDeclarations. Maybe null, if no variables were found.
      • getDefs

        private java.util.List<de.uni_hildesheim.sse.vil.templatelang.templateLang.VilDef> getDefs​(org.eclipse.xtext.nodemodel.INode node)
        Returns a list with all def-Declarations inside of an VTL-Script.
        Parameters:
        node - the last complete node.
        Returns:
        List with all def-Declarations. Maybe null, if no defs were found.
      • findDefDeclaration

        private de.uni_hildesheim.sse.vil.templatelang.templateLang.impl.VilDefImpl findDefDeclaration​(org.eclipse.xtext.nodemodel.INode node)
        finds the VilDefImpl object inside of a statement.
        Parameters:
        node - the last complete node.
        Returns:
        the VilDefImpl object, when you are inside of the def-declaration. Maybe null, if it's not found. Be sure you are using this method only inside of a def-declaration.
      • getParamsFromDef

        private org.eclipse.emf.common.util.EList<de.uni_hildesheim.sse.vil.expressions.expressionDsl.Parameter> getParamsFromDef​(org.eclipse.xtext.nodemodel.INode node)
        Returns a list with all parameters the def-Declaration have.
        Parameters:
        node - the last complete node.
        Returns:
        EList with all parameters. Maybe null, if no parameters were found.
      • getParamsFromTemplate

        private org.eclipse.emf.common.util.EList<de.uni_hildesheim.sse.vil.expressions.expressionDsl.Parameter> getParamsFromTemplate​(org.eclipse.xtext.nodemodel.INode node)
        Returns a list with all parameters the template have.
        Parameters:
        node - the last complete node.
        Returns:
        EList with all parameters. Maybe null, if no parameters were found.