com.borland.primetime.wizard
Class WizardAction

java.lang.Object
  |
  +--javax.swing.AbstractAction
        |
        +--com.borland.primetime.actions.UpdateAction
              |
              +--com.borland.primetime.wizard.WizardAction

public abstract class WizardAction
extends UpdateAction

A WizardAction is a type of UpdateAction that represents a Wizard.

WizardActions are registered by calling the static method: WizardManager.registerWizardAction(WizardAction wizard)

A WizardAction functions as a regular Action object - it stores the shortText, longText, icon, and enabled state for a Wizard. When invoked, a WizardAction will create the associated Wizard and display it in the WizardDialog.

The WizardAction adds several properties to the UpdateAction designed to support different aspects of Wizards. The 'galleryWizard' property is used to define where the Wizard should appear in the Browser UI. The 'category' property is used to define a sub-category (Gallery tab) to place Wizard under. The 'largeIcon' property is used to when the WizardAction is displayed in the Gallery.

The only WizardAction method that needs to be overridden by a subclass is the createWizard() method. When the WizardAction is invoked, the a WizardDialog is created with the contained Wizard, and the Wizard session is started. The protected method protected abstract Wizard createWizard() must be overridden to instantiate the Wizard when it is invoked. This method is called each time the Wizard is invoked, and the resources are released after the Wizard is complete.

See Also:
UpdateAction, Wizard, Serialized Form

Field Summary
static java.lang.String CATEGORY
          The storage attribute key for the CATEGORY (String) property.
static java.lang.String GALLERY_WIZARD
          The storage attribute key for the GALLERY_WIZARD (Boolean) property.
 
Fields inherited from class com.borland.primetime.actions.UpdateAction
ACCELERATOR, EMPTY_ARRAY, HELP_TOPIC, LARGE_ICON, MNEMONIC
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Constructor Summary
WizardAction()
          Constructs a WizardAction will all default properties.
WizardAction(java.lang.String shortText)
          Constructs a WizardAction will the specified short text.
WizardAction(java.lang.String shortText, char mnemonic)
          Constructs a WizardAction will the specified short text and mnemonic.
WizardAction(java.lang.String shortText, char mnemonic, java.lang.String longText)
          Constructs a WizardAction will the specified short text, mnemonic, and long text.
WizardAction(java.lang.String shortText, char mnemonic, java.lang.String longText, javax.swing.Icon smallIcon)
          Constructs a WizardAction will the specified short text, mnemonic, long text, and small icon.
WizardAction(java.lang.String shortText, char mnemonic, java.lang.String longText, javax.swing.Icon smallIcon, javax.swing.Icon largeIcon)
          Constructs a WizardAction will the specified short text, mnemonic, long text, small icon, and large icon.
WizardAction(java.lang.String shortText, char mnemonic, java.lang.String longText, javax.swing.Icon smallIcon, javax.swing.Icon largeIcon, boolean galleryWizard)
          Constructs a WizardAction will the specified short text, mnemonic, long text, small icon, large icon, and galleryWizard setting.
WizardAction(java.lang.String shortText, char mnemonic, java.lang.String longText, javax.swing.Icon smallIcon, javax.swing.Icon largeIcon, boolean galleryWizard, java.lang.String category)
          Constructs a WizardAction will the specified short text, mnemonic, long text, small icon, large icon, galleryWizard setting, and category.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           The default behavior of this method is to invoke the wizard.
protected abstract  Wizard createWizard()
          Override this method to defer the instantiation of the Wizard until is is actually invoked.
 java.lang.String getCategory()
          Returns the category for this WizardAction.
 void invokeWizard(Browser browser)
           The default behavior of this method is to obtain a new Wizard instance and invoke the WizardDialog with it.
 boolean isGalleryWizard()
          Returns the galleryWizard property setting.
 void setCategory(java.lang.String category)
          Sets the category for this WizardAction.
 void setGalleryWizard(boolean galleryWizard)
          Sets the boolean galleryWizard flag for this WizardAction.
 
Methods inherited from class com.borland.primetime.actions.UpdateAction
getHelpTopic, getLargeIcon, getLongText, getMnemonic, getShortText, getSmallIcon, setHelpTopic, setLargeIcon, setLongText, setMnemonic, setShortText, setSmallIcon, update
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GALLERY_WIZARD

public static final java.lang.String GALLERY_WIZARD
The storage attribute key for the GALLERY_WIZARD (Boolean) property. When the GALLERY_WIZARD attribute is set to 'Boolean.TRUE', the WizardAction will be displayed on a tab in the Gallery. If it is set to 'Boolean.FALSE' (or other/unset), the WizardAction appears in the Wizards menu.

CATEGORY

public static final java.lang.String CATEGORY
The storage attribute key for the CATEGORY (String) property. When the CATEGORY attribute is set, the WizardAction will appear in the specified category (a tab in the Gallery, or a pop-up in the Wizards menu). If the category is unspecified, the WizardAction will appear on the 'New' tab in the Gallery, or on the top-level of the Wizards menu.
Constructor Detail

WizardAction

public WizardAction()
Constructs a WizardAction will all default properties.

WizardAction

public WizardAction(java.lang.String shortText)
Constructs a WizardAction will the specified short text.
Parameters:
shortText - The short text for the WizardAction

WizardAction

public WizardAction(java.lang.String shortText,
                    char mnemonic)
Constructs a WizardAction will the specified short text and mnemonic.
Parameters:
shortText - The short text for the WizardAction
mnemonic - The mnemonic character for the WizardAction

WizardAction

public WizardAction(java.lang.String shortText,
                    char mnemonic,
                    java.lang.String longText)
Constructs a WizardAction will the specified short text, mnemonic, and long text.
Parameters:
shortText - The short text for the WizardAction
mnemonic - The mnemonic character for the WizardAction
longText - The long text for the WizardAction

WizardAction

public WizardAction(java.lang.String shortText,
                    char mnemonic,
                    java.lang.String longText,
                    javax.swing.Icon smallIcon)
Constructs a WizardAction will the specified short text, mnemonic, long text, and small icon.
Parameters:
shortText - The short text for the WizardAction
mnemonic - The mnemonic character for the WizardAction
longText - The long text for the WizardAction
smallIcon - The small icon for the WizardAction (16x16)

WizardAction

public WizardAction(java.lang.String shortText,
                    char mnemonic,
                    java.lang.String longText,
                    javax.swing.Icon smallIcon,
                    javax.swing.Icon largeIcon)
Constructs a WizardAction will the specified short text, mnemonic, long text, small icon, and large icon.
Parameters:
shortText - The short text for the WizardAction
mnemonic - The mnemonic character for the WizardAction
longText - The long text for the WizardAction
smallIcon - The small icon for the WizardAction (16x16)
largeIcon - The large icon for the WizardAction (32x32)

WizardAction

public WizardAction(java.lang.String shortText,
                    char mnemonic,
                    java.lang.String longText,
                    javax.swing.Icon smallIcon,
                    javax.swing.Icon largeIcon,
                    boolean galleryWizard)
Constructs a WizardAction will the specified short text, mnemonic, long text, small icon, large icon, and galleryWizard setting.
Parameters:
shortText - The short text for the WizardAction
mnemonic - The mnemonic character for the WizardAction
longText - The long text for the WizardAction
smallIcon - The small icon for the WizardAction (16x16)
largeIcon - The large icon for the WizardAction (32x32)
galleryWizard - true to appear in the gallery, false to appear on the wizards menu

WizardAction

public WizardAction(java.lang.String shortText,
                    char mnemonic,
                    java.lang.String longText,
                    javax.swing.Icon smallIcon,
                    javax.swing.Icon largeIcon,
                    boolean galleryWizard,
                    java.lang.String category)
Constructs a WizardAction will the specified short text, mnemonic, long text, small icon, large icon, galleryWizard setting, and category.
Parameters:
shortText - The short text for the WizardAction
mnemonic - The mnemonic character for the WizardAction
longText - The long text for the WizardAction
smallIcon - The small icon for the WizardAction (16x16)
largeIcon - The large icon for the WizardAction (32x32)
galleryWizard - true to appear in the gallery, false to appear on the wizards menu
category - The category for this WizardAction
Method Detail

setGalleryWizard

public void setGalleryWizard(boolean galleryWizard)
Sets the boolean galleryWizard flag for this WizardAction. The galleryWizard flag determines wether the wizard will appear in the gallery dialog or in the wizards menu. Typically, gallery wizards are ones that create new files. Non-gallery wizards operate on existing files.
Parameters:
galleryWizard - true for the wizard to appear in the gallery, false for the wizard to appear on the wizards menu

isGalleryWizard

public boolean isGalleryWizard()
Returns the galleryWizard property setting.
Returns:
The state of the galleryWizard property.

setCategory

public void setCategory(java.lang.String category)
Sets the category for this WizardAction. The category determines which group the WizardAction will appear in. This should be relatively short (one or two words if possible).
Parameters:
category - The category for the WizardAction

getCategory

public java.lang.String getCategory()
Returns the category for this WizardAction.
Returns:
The category for the WizardAction

createWizard

protected abstract Wizard createWizard()
Override this method to defer the instantiation of the Wizard until is is actually invoked. This method is called each time the Wizard is invoked.

invokeWizard

public final void invokeWizard(Browser browser)

The default behavior of this method is to obtain a new Wizard instance and invoke the WizardDialog with it. This method cannot be overridden, but createWizard *must* be.


actionPerformed

public final void actionPerformed(java.awt.event.ActionEvent e)

The default behavior of this method is to invoke the wizard.

Overrides:
actionPerformed in class javax.swing.AbstractAction