Search in sources :

Example 6 with ASTNode

use of abs.frontend.ast.ASTNode in project abstools by abstools.

the class TypeHierarchyView method doubleClick.

@Override
public void doubleClick(DoubleClickEvent event) {
    // when an element is doubleclicked, jump to its declaration
    ISelection selected = treeViewer.getSelection();
    if (selected instanceof TreeSelection) {
        TreeSelection treeSelection = (TreeSelection) selected;
        Object elem = treeSelection.getFirstElement();
        if (elem instanceof ASTNode<?>) {
            ASTNode<?> node = (ASTNode<?>) elem;
            EditorPosition pos = AbsHyperlinkDetector.getPosition(node);
            UtilityFunctions.jumpToPosition(project, pos);
        }
    }
}
Also used : EditorPosition(org.absmodels.abs.plugin.util.UtilityFunctions.EditorPosition) TreeSelection(org.eclipse.jface.viewers.TreeSelection) ISelection(org.eclipse.jface.viewers.ISelection) InternalASTNode(org.absmodels.abs.plugin.util.InternalASTNode) ASTNode(abs.frontend.ast.ASTNode)

Aggregations

ASTNode (abs.frontend.ast.ASTNode)6 ArrayList (java.util.ArrayList)2 InternalASTNode (org.absmodels.abs.plugin.util.InternalASTNode)2 DefaultABSFormatter (abs.backend.prettyprint.DefaultABSFormatter)1 WrongProgramArgumentException (abs.common.WrongProgramArgumentException)1 SemanticConditionList (abs.frontend.analyser.SemanticConditionList)1 SemanticError (abs.frontend.analyser.SemanticError)1 DeltaAccess (abs.frontend.ast.DeltaAccess)1 DeltaDecl (abs.frontend.ast.DeltaDecl)1 Model (abs.frontend.ast.Model)1 ModuleDecl (abs.frontend.ast.ModuleDecl)1 ProductDecl (abs.frontend.ast.ProductDecl)1 DeltaModellingException (abs.frontend.delta.DeltaModellingException)1 DeltaModellingWithNodeException (abs.frontend.delta.DeltaModellingWithNodeException)1 ABSFormatter (abs.frontend.tests.ABSFormatter)1 TypeCheckerException (abs.frontend.typechecker.TypeCheckerException)1 LocationType (abs.frontend.typechecker.locationtypes.LocationType)1 LocationTypeInferrerExtension (abs.frontend.typechecker.locationtypes.infer.LocationTypeInferrerExtension)1 DeltaWrapper (apet.absunit.DeltaForGetSetFieldsBuilder.DeltaWrapper)1 FileNotFoundException (java.io.FileNotFoundException)1