01: /*****************************************************************************************
02: * Copyright (c) 2007 Andrei Loskutov. All rights reserved. This program and the
03: * accompanying materials are made available under the terms of the BSD License which
04: * accompanies this distribution, and is available at
05: * http://www.opensource.org/licenses/bsd-license.php Contributor: Andrei Loskutov -
06: * initial API and implementation
07: ****************************************************************************************/package de.loskutov.bco.ui.actions;
08:
09: import org.eclipse.jface.action.IAction;
10: import org.eclipse.jface.viewers.ISelection;
11: import org.eclipse.ui.IViewActionDelegate;
12: import org.eclipse.ui.IViewPart;
13: import org.eclipse.ui.PartInitException;
14: import org.eclipse.ui.PlatformUI;
15:
16: import de.loskutov.bco.BytecodeOutlinePlugin;
17:
18: /**
19: * Opens a bytecode reference from view
20: * @author Andrei
21: */
22: public class OpenBytecodeReferenceAction implements IViewActionDelegate {
23:
24: public OpenBytecodeReferenceAction() {
25: super ();
26: }
27:
28: /*
29: * (non-Javadoc)
30: * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
31: */
32: public void run(IAction action) {
33: try {
34: PlatformUI
35: .getWorkbench()
36: .getActiveWorkbenchWindow()
37: .getActivePage()
38: .showView(
39: "de.loskutov.bco.views.BytecodeReferenceView");
40: } catch (PartInitException e) {
41: BytecodeOutlinePlugin.error(
42: "Could not open Bytecode Reference View: "
43: + e.getMessage(), e);
44: }
45:
46: }
47:
48: /*
49: * (non-Javadoc)
50: * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
51: * org.eclipse.jface.viewers.ISelection)
52: */
53: public void selectionChanged(IAction action, ISelection selection) {
54: // no op
55: }
56:
57: public void init(IViewPart view) {
58: // no op
59: }
60:
61: }
|