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
9 * IBM - Initial API and implementation
11 package org.eclipse.webbrowser;
13 import org.eclipse.jface.viewers.ISelection;
14 import org.eclipse.jface.action.IAction;
15 import org.eclipse.ui.*;
16 import org.eclipse.webbrowser.WebBrowser;
17 import org.eclipse.webbrowser.WebBrowserEditorInput;
19 * Action to open the Web broswer.
21 public class OpenBrowserWorkbenchAction implements IWorkbenchWindowActionDelegate {
23 * OpenBrowserWorkbenchAction constructor comment.
25 public OpenBrowserWorkbenchAction() {
30 * Disposes this action delegate. The implementor should unhook any references
31 * to itself so that garbage collection can occur.
33 public void dispose() { }
36 * Initializes this action delegate with the workbench window it will work in.
38 * @param window the window that provides the context for this delegate
40 public void init(IWorkbenchWindow window) { }
43 * Performs this action.
45 * This method is called when the delegating action has been triggered.
46 * Implement this method to do the actual work.
49 * @param action the action proxy that handles the presentation portion of the
52 public void run(IAction action) {
53 WebBrowser.openURL(new WebBrowserEditorInput(null, WebBrowserEditorInput.SHOW_ALL | WebBrowserEditorInput.FORCE_NEW_PAGE));
57 * Notifies this action delegate that the selection in the workbench has changed.
59 * Implementers can use this opportunity to change the availability of the
60 * action or to modify other presentation properties.
63 * @param action the action proxy that handles presentation portion of the action
64 * @param selection the current selection in the workbench
66 public void selectionChanged(IAction action, ISelection selection) { }