1 11 package org.eclipse.jdt.internal.ui.actions; 12 13 import org.eclipse.swt.widgets.Shell; 14 15 import org.eclipse.jface.action.IAction; 16 import org.eclipse.jface.viewers.ISelection; 17 import org.eclipse.jface.viewers.IStructuredSelection; 18 import org.eclipse.jface.viewers.StructuredSelection; 19 20 import org.eclipse.ui.IWorkbenchWindow; 21 import org.eclipse.ui.IWorkbenchWindowActionDelegate; 22 23 import org.eclipse.jdt.internal.ui.javadocexport.JavadocWizard; 24 25 public class GenerateJavadocAction implements IWorkbenchWindowActionDelegate { 26 27 private ISelection fSelection; 28 private Shell fCurrentShell; 29 30 public void dispose() { 31 } 32 33 public void init(IWorkbenchWindow window) { 34 fCurrentShell= window.getShell(); 35 } 36 37 public void run(IAction action) { 38 JavadocWizard wizard= new JavadocWizard(); 39 IStructuredSelection selection= null; 40 if (fSelection instanceof IStructuredSelection) { 41 selection= (IStructuredSelection)fSelection; 42 } else { 43 selection= new StructuredSelection(); 44 } 45 JavadocWizard.openJavadocWizard(wizard, fCurrentShell, selection); 46 } 47 48 public void selectionChanged(IAction action, ISelection selection) { 49 fSelection= selection; 50 } 51 } 52 | Popular Tags |