1 11 12 package org.eclipse.jdt.ui.actions; 13 14 import org.eclipse.core.runtime.CoreException; 15 16 import org.eclipse.jface.viewers.IStructuredSelection; 17 18 import org.eclipse.ui.INewWizard; 19 import org.eclipse.ui.PlatformUI; 20 21 import org.eclipse.jdt.ui.wizards.NewAnnotationWizardPage; 22 23 import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; 24 import org.eclipse.jdt.internal.ui.JavaPlugin; 25 import org.eclipse.jdt.internal.ui.JavaPluginImages; 26 import org.eclipse.jdt.internal.ui.actions.ActionMessages; 27 import org.eclipse.jdt.internal.ui.wizards.NewAnnotationCreationWizard; 28 29 41 public class OpenNewAnnotationWizardAction extends AbstractOpenWizardAction { 42 43 private NewAnnotationWizardPage fPage; 44 private boolean fOpenEditorOnFinish; 45 46 49 public OpenNewAnnotationWizardAction() { 50 setText(ActionMessages.OpenNewAnnotationWizardAction_text); 51 setDescription(ActionMessages.OpenNewAnnotationWizardAction_description); 52 setToolTipText(ActionMessages.OpenNewAnnotationWizardAction_tooltip); 53 setImageDescriptor(JavaPluginImages.DESC_WIZBAN_NEWANNOT); 54 PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.OPEN_ANNOTATION_WIZARD_ACTION); 55 setShell(JavaPlugin.getActiveWorkbenchShell()); 56 57 fPage= null; 58 fOpenEditorOnFinish= true; 59 } 60 61 66 public void setConfiguredWizardPage(NewAnnotationWizardPage page) { 67 fPage= page; 68 } 69 70 78 public void setOpenEditorOnFinish(boolean openEditorOnFinish) { 79 fOpenEditorOnFinish= openEditorOnFinish; 80 } 81 82 85 protected final INewWizard createWizard() throws CoreException { 86 return new NewAnnotationCreationWizard(fPage, fOpenEditorOnFinish); 87 } 88 } 89 | Popular Tags |