+++ /dev/null
-/*\r
- * To change this template, choose Tools | Templates\r
- * and open the template in the editor.\r
- */\r
-package org.plant.creator;\r
-\r
-import java.awt.Dialog;\r
-import java.awt.event.ActionEvent;\r
-import java.awt.event.ActionListener;\r
-import java.text.MessageFormat;\r
-import org.openide.DialogDisplayer;\r
-import org.openide.WizardDescriptor;\r
-import org.openide.awt.ActionRegistration;\r
-import org.openide.awt.ActionReference;\r
-import org.openide.awt.ActionReferences;\r
-import org.openide.awt.ActionID;\r
-import org.openide.util.NbBundle.Messages;\r
-\r
-@ActionID(category = "File",\r
-id = "org.plant.creator.PlantCreatorAction")\r
-@ActionRegistration(displayName = "#CTL_PlantCreatorAction")\r
-@ActionReferences({\r
- @ActionReference(path = "Menu/File", position = 0)\r
-})\r
-@Messages("CTL_PlantCreatorAction=Create Plant")\r
-public final class PlantCreatorAction implements ActionListener {\r
-\r
- @Override\r
- public void actionPerformed(ActionEvent e) {\r
-\r
- // To invoke this wizard, copy-paste and run the following code, e.g. from\r
- // SomeAction.performAction():\r
- PlantCreationIterator iterator = new PlantCreationIterator();\r
- WizardDescriptor wizardDescriptor = new WizardDescriptor(iterator);\r
- iterator.initialize(wizardDescriptor);\r
- // {0} will be replaced by WizardDescriptor.Panel.getComponent().getName()\r
- // {1} will be replaced by WizardDescriptor.Iterator.name()\r
- wizardDescriptor.setTitleFormat(new MessageFormat("{0} ({1})"));\r
- wizardDescriptor.setTitle("Plant Creator Wizard");\r
- Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor);\r
- dialog.setVisible(true);\r
- dialog.toFront();\r
- boolean cancelled = wizardDescriptor.getValue() != WizardDescriptor.FINISH_OPTION;\r
- if (!cancelled) {\r
- // do something\r
- }\r
- }\r
-}\r