Package de.uni_hildesheim.sse.ui.outline
Class IvmlOutlineTreeProvider
- java.lang.Object
-
- org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider
-
- de.uni_hildesheim.sse.ui.outline.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.DefaultOutlineTreeProviderCustomization 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.IImageHelperimageHelper
-
Constructor Summary
Constructors Constructor Description IvmlOutlineTreeProvider()
-
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 voidcreateAssignNodes(java.util.List<de.uni_hildesheim.sse.ivml.AttrAssignment> assignList, org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode)Create attribute-assignment nodes.private voidcreateAttributeNodes(java.util.List<de.uni_hildesheim.sse.ivml.AnnotateTo> attrList, org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode)Create attribute-nodes.private voidcreateConflictNodes(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 voidcreateDVNodes(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 voidcreateExpressionNodes(java.util.List<de.uni_hildesheim.sse.ivml.ExpressionStatement> exprList, org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode)Create specific expression-nodes.private voidcreateFreezeNodes(java.util.List<de.uni_hildesheim.sse.ivml.Freeze> freezeList, org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode)Create freeze-nodes.private voidcreateImportNodes(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 voidcreateInterfaceNodes(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 voidcreateOpDefStatement(java.util.List<de.uni_hildesheim.sse.ivml.OpDefStatement> opDefList, org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode)Create operation-definition-nodes.protected voidcreateProjectContents(org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode, de.uni_hildesheim.sse.ivml.ProjectContents contents)Create child-nodes for project-contents.private voidcreateTypeDefNodes(java.util.List<de.uni_hildesheim.sse.ivml.Typedef> typedefList, org.eclipse.xtext.ui.editor.outline.IOutlineNode parentNode)Create type-definition-nodes.private booleanisEmpty(de.uni_hildesheim.sse.ivml.AnnotateTo attrStmt)Check whether the attribute-statement is empty.private booleanisEmpty(de.uni_hildesheim.sse.ivml.ProjectContents pContents)Check whether the given project-contents.private booleanisEmpty(de.uni_hildesheim.sse.ivml.TypedefCompound tdefCompound)Check whether the given compound-definition is empty.private booleanisEmpty(de.uni_hildesheim.sse.ivml.TypedefEnum tdefEnum)Check whether the given enum-definition is empty.private booleanisEmpty(de.uni_hildesheim.sse.ivml.TypedefMapping tdefMapping)Check whether the given type-mapping is empty.private booleanisEmpty(de.uni_hildesheim.sse.ivml.VariableDeclaration varDecl)Check whether the given variable-declaration is empty.private static booleanisEmpty(java.util.List<?> list)Check whether a given List is null or empty.private static booleanisEmpty(org.eclipse.emf.common.util.EList<?> list)Check whether a given EList is null or empty.private booleannoNames(de.uni_hildesheim.sse.ivml.AnnotateTo attrStmt)Check whether the attribute-statement has no names (the elements the attribute is assigned to).private booleannoRelations(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
-
-
-
-
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.
-
-