1 /*******************************************************************************
2 * Copyright (c) 2000, 2005 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package org.eclipse.jdt.internal.ui.wizards;
13 import org.eclipse.jface.action.IAction;
14 import org.eclipse.jface.viewers.ISelection;
15 import org.eclipse.jface.viewers.IStructuredSelection;
16 import org.eclipse.jface.viewers.StructuredSelection;
18 import org.eclipse.ui.IWorkbenchWindow;
19 import org.eclipse.ui.IWorkbenchWindowActionDelegate;
21 import org.eclipse.jdt.ui.actions.OpenNewJavaProjectWizardAction;
23 public class OpenJavaProjectWizardToolbarAction extends OpenNewJavaProjectWizardAction implements IWorkbenchWindowActionDelegate {
25 public OpenJavaProjectWizardToolbarAction() {
29 * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
31 public void dispose() {
35 * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
37 public void init(IWorkbenchWindow window) {
38 setShell(window.getShell());
42 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
44 public void run(IAction action) {
49 * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
51 public void selectionChanged(IAction action, ISelection selection) {
52 if (selection instanceof IStructuredSelection) {
53 setSelection((IStructuredSelection) selection);
55 setSelection(StructuredSelection.EMPTY);