Search in sources :

Example 1 with OpenFileHandler

use of org.eclipse.linuxtools.internal.systemtap.ui.ide.OpenFileHandler in project linuxtools by eclipse.

the class DefinitionHandler method execute.

@Override
public Object execute(ExecutionEvent event) {
    TreeDefinitionNode t = getSelection(event);
    if (t == null) {
        return null;
    }
    String filename = t.getDefinition();
    if (filename == null) {
        return null;
    }
    File file = new File(filename);
    OpenFileHandler open = new OpenFileHandler();
    open.executeOnFile(file);
    if (open.isSuccessful() && t.getData() instanceof ISearchableNode) {
        IEditorPart editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
        STPEditor editor = (STPEditor) editorPart;
        editor.jumpToLocation(findDefinitionLine((ISearchableNode) t.getData(), editor) + 1, 0);
    }
    return null;
}
Also used : OpenFileHandler(org.eclipse.linuxtools.internal.systemtap.ui.ide.OpenFileHandler) TreeDefinitionNode(org.eclipse.linuxtools.systemtap.structures.TreeDefinitionNode) ISearchableNode(org.eclipse.linuxtools.internal.systemtap.ui.ide.structures.nodedata.ISearchableNode) STPEditor(org.eclipse.linuxtools.internal.systemtap.ui.ide.editors.stp.STPEditor) IEditorPart(org.eclipse.ui.IEditorPart) File(java.io.File)

Aggregations

File (java.io.File)1 OpenFileHandler (org.eclipse.linuxtools.internal.systemtap.ui.ide.OpenFileHandler)1 STPEditor (org.eclipse.linuxtools.internal.systemtap.ui.ide.editors.stp.STPEditor)1 ISearchableNode (org.eclipse.linuxtools.internal.systemtap.ui.ide.structures.nodedata.ISearchableNode)1 TreeDefinitionNode (org.eclipse.linuxtools.systemtap.structures.TreeDefinitionNode)1 IEditorPart (org.eclipse.ui.IEditorPart)1