public abstract class Wizard extends java.lang.Object implements Invokable
The exact mechanism for invocation is up to the Wizard. Some Wizards
register a menu label which is used to create a menu item under
the "Tools" menu and are invoked when the user selects that
menu item. Others create a menu item in a different menu (and may
even create a new menu). Still other Wizards are available in
the Gallery (File|New). Note: it is not necessary to subclass
Wizard in order to register a gallery item; the class must only extend
Invokable
.
If the Wizard returns a non-null String
from the
getMenuLabel
method, then registering the Wizard with the
WizardManager
will add a menu item under the "Tools" menu.
If the Wizard needs to appear in a different menu, then the Wizard needs to
implement the Addin
interface, and manually create an
IdeAction
, a JMenuItem
,
and add it to the appropriate menu in IdeMainWindow
.
IdeAction
,
IdeMainWindow
,
WizardManager
,
Addin
,
Invokable
Constructor and Description |
---|
Wizard() |
Modifier and Type | Method and Description |
---|---|
javax.swing.Icon |
getIcon()
Gets the
Icon to use in the Object Gallery. |
static java.lang.String[] |
getLegacyParams(Context context)
Gets the array of String from the specified Context that
represent the legacy parameters for the Wizard API used by some
older Wizard implementations and Wizard launchers.
|
java.lang.String |
getLongLabel()
Provides a description of the Wizard that appears in the hint text
area of the Object Gallery.
|
MenuSpec |
getMenuSpecification()
Provides the menu specification used by this Wizard.
|
abstract java.lang.String |
getShortLabel()
Provides the label that represents the Wizard in the Object Gallery.
|
java.lang.String |
getToolTipText()
The tool tip text to display when the mouse hovers over this
Wizard's item in the Object Gallery.
|
static java.lang.String |
getWizardId(Context context)
Gets the ID from the specified Context.
|
abstract boolean |
isAvailable(Context context)
Called when the sensitivity of the menu item that opens this
wizard must be determined.
|
static void |
setLegacyParams(Context context,
java.lang.String[] params)
Sets the String array that represents the legacy parameters for the
Wizard API.
|
static void |
setWizardId(Context context,
java.lang.String id)
Sets the ID for the Wizard.
|
java.lang.String |
toString()
Returns a String describing the Wizard.
|
public abstract boolean isAvailable(Context context)
context
- The Context
to use when invoking this
Wizard
.true
if the wizard can be invoked, or
false
otherwise.public abstract java.lang.String getShortLabel()
public java.lang.String getLongLabel()
getShortLabel()
.public javax.swing.Icon getIcon()
Icon
to use in the Object Gallery. If this Wizard
is not accessed from the Object Gallery, the Wizard should return
null
.Icon
to be displayed in the Object Gallery.public java.lang.String getToolTipText()
public java.lang.String toString()
getShortLabel()
.toString
in class java.lang.Object
public static final java.lang.String getWizardId(Context context)
public static final void setWizardId(Context context, java.lang.String id)
public static final java.lang.String[] getLegacyParams(Context context)
public static final void setLegacyParams(Context context, java.lang.String[] params)
public MenuSpec getMenuSpecification()
If this Wizard is not invokable from the "Tools" menu,
return null
.