Class TemplateLangProposalProviderUtility
- java.lang.Object
-
- de.uni_hildesheim.sse.vil.templatelang.ui.contentassist.TemplateLangProposalProviderUtility
-
public class TemplateLangProposalProviderUtility extends java.lang.ObjectA 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.)
-
-
Field Summary
Fields Modifier and Type Field Description static TemplateLangProposalProviderUtilityINSTANCEThe current instance of the utility class.
-
Constructor Summary
Constructors Constructor Description TemplateLangProposalProviderUtility()prevents external creation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private de.uni_hildesheim.sse.vil.templatelang.templateLang.impl.VilDefImplfindDefDeclaration(org.eclipse.xtext.nodemodel.INode node)finds theVilDefImplobject 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)
-
-
-
Field Detail
-
INSTANCE
public static final TemplateLangProposalProviderUtility INSTANCE
The current instance of the utility class. Prevent parallel access to the parse tree.
-
-
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:
Listwith 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- listListwith the specific types.- Returns:
Listwith 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:
Listwith 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:
Listwith 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:
Listwith 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:
Listwith 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- theINodeobject (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- theINodeobject (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:
Listwith 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 theVilDefImplobject inside of a statement.- Parameters:
node- the last complete node.- Returns:
- the
VilDefImplobject, 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:
EListwith 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:
EListwith all parameters. Maybe null, if no parameters were found.
-
-