1 11 package org.eclipse.jdt.internal.ui.wizards; 12 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; 17 18 import org.eclipse.ui.IWorkbenchWindow; 19 import org.eclipse.ui.IWorkbenchWindowActionDelegate; 20 21 import org.eclipse.jdt.ui.actions.OpenNewJavaProjectWizardAction; 22 23 public class OpenJavaProjectWizardToolbarAction extends OpenNewJavaProjectWizardAction implements IWorkbenchWindowActionDelegate { 24 25 public OpenJavaProjectWizardToolbarAction() { 26 } 27 28 31 public void dispose() { 32 } 33 34 37 public void init(IWorkbenchWindow window) { 38 setShell(window.getShell()); 39 } 40 41 44 public void run(IAction action) { 45 super.run(); 46 } 47 48 51 public void selectionChanged(IAction action, ISelection selection) { 52 if (selection instanceof IStructuredSelection) { 53 setSelection((IStructuredSelection) selection); 54 } else { 55 setSelection(StructuredSelection.EMPTY); 56 } 57 } 58 } | Popular Tags |