Class TemplateLangOutlineTreeProvider
- java.lang.Object
-
- org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider
-
- de.uni_hildesheim.sse.vil.templatelang.ui.outline.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.DefaultOutlineTreeProvidercustomization 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.IImageHelperimageHelper
-
Constructor Summary
Constructors Constructor Description TemplateLangOutlineTreeProvider()
-
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 booleancheckAdviceName(de.uni_hildesheim.sse.vil.expressions.expressionDsl.Advice advice)Checks whether a given advice is not null and has a name.private booleancheckCompoundNode(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 booleancheckIndentation(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 booleancheckParameter(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 booleancheckTypedefNode(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 booleancheckVariableDeclaration(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 voidcreateAdviceNodes(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 voidcreateCompoundNode(de.uni_hildesheim.sse.vil.expressions.expressionDsl.Compound compound, VirtualOutlineNode parentNode)Creates the Compounds.private voidcreateDefNode(de.uni_hildesheim.sse.vil.templatelang.templateLang.VilDef def, org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode)Creates the node for 'def' declarations.private voidcreateImportNodes(org.eclipse.emf.common.util.EList<de.uni_hildesheim.sse.vil.expressions.expressionDsl.Import> importList, VirtualOutlineNode parentNode)Creates the nodes for the imports.private voidcreateIndentNodes(org.eclipse.emf.common.util.EList<de.uni_hildesheim.sse.vil.templatelang.templateLang.IndentationHintPart> indList, VirtualOutlineNode parentNode)Creates the nodes for '@indent'.private voidcreateJavaExtNodes(org.eclipse.emf.common.util.EList<de.uni_hildesheim.sse.vil.templatelang.templateLang.Extension> javExts, VirtualOutlineNode parentNode)Creates the nodes for java extensions.private voidcreateParameterNodes(org.eclipse.emf.common.util.EList<de.uni_hildesheim.sse.vil.expressions.expressionDsl.Parameter> paramList, VirtualOutlineNode parentNode)Creates the nodes for parameters.private voidcreateScriptContentNodes(org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.EObject> elements, VirtualOutlineNode parentNode)Creates the DefDeclarations and the VariableDeclarations.private voidcreateTemplateNodes(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 voidcreateTypdefNode(de.uni_hildesheim.sse.vil.expressions.expressionDsl.TypeDef typedef, VirtualOutlineNode parentNode)Creates the type defs.private voidcreateVariableNode(de.uni_hildesheim.sse.vil.expressions.expressionDsl.VariableDeclaration var, VirtualOutlineNode parentNode)Creates the VariableDeclarations.private voidcreateVersionNode(de.uni_hildesheim.sse.vil.expressions.expressionDsl.VersionStmt version, org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode)Creates the version node.private booleanhasContents(de.uni_hildesheim.sse.vil.templatelang.templateLang.LanguageUnit templateUnit)Checks whether a given template includes variable declarations or sub-template (def) declarations.private static booleanisEmpty(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
-
-
-
-
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 nodeunit- 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 AdvicesparentNode- 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 TemplateparentNode- 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 declarationssubTemps- the list of su-template declarationsparentNode- 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' declarationparentNode- 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- versionparentNode- 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 importsparentNode- 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 extensionsparentNode- 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 parametersparentNode- 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 indentsparentNode- the parent node
-
createTypdefNode
private void createTypdefNode(de.uni_hildesheim.sse.vil.expressions.expressionDsl.TypeDef typedef, VirtualOutlineNode parentNode)Creates the type defs.- Parameters:
typedef- typedefparentNode- 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- compoundparentNode- 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- variableparentNode- 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.
-
-