Enable first implementation of value change in varialbles view.
[phpeclipse.git] / net.sourceforge.phpeclipse.webbrowser / src / net / sourceforge / phpeclipse / webbrowser / OpenBrowserWorkbenchAction.java
1 /**
2  * Copyright (c) 2003 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  �*
8  * Contributors:
9  *    IBM - Initial API and implementation
10  */
11 package net.sourceforge.phpeclipse.webbrowser;
12
13 import org.eclipse.jface.action.IAction;
14 import org.eclipse.jface.viewers.ISelection;
15 import org.eclipse.ui.IWorkbenchWindow;
16 import org.eclipse.ui.IWorkbenchWindowActionDelegate;
17
18 /**
19  * Action to open the Web broswer.
20  */
21 public class OpenBrowserWorkbenchAction implements
22                 IWorkbenchWindowActionDelegate {
23         /**
24          * OpenBrowserWorkbenchAction constructor comment.
25          */
26         public OpenBrowserWorkbenchAction() {
27                 super();
28         }
29
30         /**
31          * Disposes this action delegate. The implementor should unhook any
32          * references to itself so that garbage collection can occur.
33          */
34         public void dispose() {
35         }
36
37         /**
38          * Initializes this action delegate with the workbench window it will work
39          * in.
40          * 
41          * @param window
42          *            the window that provides the context for this delegate
43          */
44         public void init(IWorkbenchWindow window) {
45         }
46
47         /**
48          * Performs this action.
49          * <p>
50          * This method is called when the delegating action has been triggered.
51          * Implement this method to do the actual work.
52          * </p>
53          * 
54          * @param action
55          *            the action proxy that handles the presentation portion of the
56          *            action
57          */
58         public void run(IAction action) {
59                 WebBrowser.openURL(new WebBrowserEditorInput(null,
60                                 WebBrowserEditorInput.SHOW_ALL
61                                                 | WebBrowserEditorInput.FORCE_NEW_PAGE));
62         }
63
64         /**
65          * Notifies this action delegate that the selection in the workbench has
66          * changed.
67          * <p>
68          * Implementers can use this opportunity to change the availability of the
69          * action or to modify other presentation properties.
70          * </p>
71          * 
72          * @param action
73          *            the action proxy that handles presentation portion of the
74          *            action
75          * @param selection
76          *            the current selection in the workbench
77          */
78         public void selectionChanged(IAction action, ISelection selection) {
79         }
80 }