Remote Systems
v6.4.1

com.ibm.etools.systems.core.ui.actions
Class SystemBaseWizardAction

java.lang.Object
  extended byAction
      extended bycom.ibm.etools.systems.core.ui.actions.SystemBaseAction
          extended bycom.ibm.etools.systems.core.ui.actions.SystemBaseDialogAction
              extended bycom.ibm.etools.systems.core.ui.actions.SystemBaseWizardAction
All Implemented Interfaces:
ISystemAction, ISystemDialogAction, ISystemWizardAction
Direct Known Subclasses:
SystemNewConnectionAction, SystemNewFileAction, SystemNewFilterAction, SystemNewFolderAction, SystemNewProfileAction

public abstract class SystemBaseWizardAction
extends SystemBaseDialogAction
implements ISystemWizardAction

A specialization for the eclipse Action method, for actions that put up wizards.

This class is most effective when used with actions that extend AbstractSystemWizard, or implement ISystemWizard. It supports settings that are propogated to the wizard, and wizard pages if they extend AbstractSystemWizardPage, or implement ISystemWizardPage.

The advantages to using this class over the base action class are:

To use this class:

  1. Create your wizard class that extends AbstractSystemWizard, and is populated with pages that extend AbstractSystemWizardPage.
  2. Define your action's label and tooltip translatable strings in a resource bundle, where the former's key ends with "label" and the latter's key ends with "tooltip".
  3. Define your subclass of this wizard. Decide if you want to set the wizard's title, page-title, image, help and optionally minimum size in your wizard subclass, or here in your action subclass. For re-use it is best to set it in the wizard, if possible.
  4. Override createWizard() to instantiate, configure and return your wizard.
  5. Decide if you will do the work of the wizard in the wizard's performFinish method, or here in this action subclass. If here, override postProcessWizard(IWizard). You might also override this if you need to set output variables in the action, after the sucessful completion of the wizard.

See Also:
Serialized Form

Field Summary
static String copyright
           
 
Fields inherited from class com.ibm.etools.systems.core.ui.actions.SystemBaseDialogAction
cancelled, dlgHelpId, needsProgressMonitor, needsProgressMonitorSet, processAll, value
 
Fields inherited from class com.ibm.etools.systems.core.ui.actions.SystemBaseAction
allowOnMultipleSelection, arrowCursor, helpId, selectionSensitive, shell, sSelection, traceSelections, traceTarget, viewer, waitCursor
 
Constructor Summary
protected SystemBaseWizardAction(ResourceBundle rb, String prefix, ImageDescriptor image, Shell parent)
          Constructor for SystemBaseWizardAction given a resource bundle from which the label, tooltip and description can be retrieved, and there is a image to display in a menu.
protected SystemBaseWizardAction(ResourceBundle rb, String prefix, Shell parent)
          Constructor for SystemBaseWizardAction given a resource bundle from which the label, tooltip and description can be retrieved, and there is no image for this action.
protected SystemBaseWizardAction(String text, ImageDescriptor image, Shell parent)
          Constructor for SystemBaseWizardAction when translated label is known.
protected SystemBaseWizardAction(String text, String tooltip, ImageDescriptor image, Shell parent)
          Constructor for SystemBaseWizardAction when translated label and tooltip are known.
protected SystemBaseWizardAction(String text, String tooltip, String description, ImageDescriptor image, Shell parent)
          Constructor for SystemBaseWizardAction when translated label and tooltip and description are all known.
 
Method Summary
protected  Dialog createDialog(Shell shell)
          Override of parent's method.
protected abstract  IWizard createWizard()
          The default processing for the run method calls createDialog, which we override in this class.
protected  Object getDialogValue(Dialog dlg)
          By default, we try to get the wizard's value by calling getOutputObject()
 String getWizardPageTitle()
          Return the page title as set via setWizardPageTitle
protected  void postProcessWizard(IWizard wizard)
          Typically, the wizard's performFinish method does the work required by a successful finish of the wizard.
 void setMinimumPageSize(int width, int height)
          Call this method to set the wizard's dimensions without having to subclass the wizard.
 void setWizardImage(ImageDescriptor wizardImage)
          Set the wizard image.
 void setWizardPageTitle(String pageTitle)
          Set the wizard page title.
 void setWizardTitle(String title)
          Set the wizard title.
 boolean wasCancelled()
          Returns true if the user cancelled the wizard.
 
Methods inherited from class com.ibm.etools.systems.core.ui.actions.SystemBaseDialogAction
getDialogHelpContextId, getNeedsProgressMonitor, getProcessAllSelections, getValue, run, setDialogHelp, setNeedsProgressMonitor, setProcessAllSelections, setValue, wasNeedsProgressMonitorSet
 
Methods inherited from class com.ibm.etools.systems.core.ui.actions.SystemBaseAction
allowOnMultipleSelection, checkObjectType, getAdapter, getContextMenuGroup, getCurrentTreeView, getDescription, getFirstSelection, getHelpContextId, getLabel, getNextSelection, getRemoteAdapter, getSelection, getSelectionProvider, getShell, getShell, getString, getStringOrNull, getSystemConnection, getToolTip, getViewer, isDummy, isEnabled, isSelectionSensitive, issueTraceMessage, selectionChanged, setAvailableOffline, setBusyCursor, setContextMenuGroup, setDisplayCursor, setDisplayCursor, setHelp, setInputs, setSelection, setSelectionProvider, setSelectionSensitive, setShell, setSystemConnection, setTracing, setTracing, setViewer, updateSelection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.etools.systems.core.ui.actions.ISystemDialogAction
getValue, setProcessAllSelections, setValue
 
Methods inherited from interface com.ibm.etools.systems.core.ui.actions.ISystemAction
allowOnMultipleSelection, getContextMenuGroup, getHelpContextId, getSelection, getShell, getViewer, isDummy, isSelectionSensitive, setContextMenuGroup, setHelp, setInputs, setSelection, setSelectionSensitive, setShell, setViewer
 

Field Detail

copyright

public static final String copyright
See Also:
Constant Field Values
Constructor Detail

SystemBaseWizardAction

protected SystemBaseWizardAction(String text,
                                 ImageDescriptor image,
                                 Shell parent)
Constructor for SystemBaseWizardAction when translated label is known. You must separately call setToolTipText and setDescription to enable these if desired.

Parameters:
text - string to display in menu or toolbar
image - icon to display in menu or toolbar. Can be null.
parent - Shell of parent window. Can be null if you don't know it, but call setShell when you do.

SystemBaseWizardAction

protected SystemBaseWizardAction(String text,
                                 String tooltip,
                                 ImageDescriptor image,
                                 Shell parent)
Constructor for SystemBaseWizardAction when translated label and tooltip are known. You must separately call setDescription to enable this if desired.

Parameters:
text - string to display in menu or toolbar
tooltip - string to display when user hovers mouse over action.
image - icon to display in menu or toolbar. Can be null.
parent - Shell of parent window. Can be null if you don't know it, but call setShell when you do.

SystemBaseWizardAction

protected SystemBaseWizardAction(String text,
                                 String tooltip,
                                 String description,
                                 ImageDescriptor image,
                                 Shell parent)
Constructor for SystemBaseWizardAction when translated label and tooltip and description are all known.

Parameters:
text - string to display in menu or toolbar
tooltip - string to display when user hovers mouse over action.
description - string displayed in status bar of some displays. Longer than tooltip.
image - icon to display in menu or toolbar. Can be null.
parent - Shell of parent window. Can be null if you don't know it, but call setShell when you do.

SystemBaseWizardAction

protected SystemBaseWizardAction(ResourceBundle rb,
                                 String prefix,
                                 ImageDescriptor image,
                                 Shell parent)
Constructor for SystemBaseWizardAction given a resource bundle from which the label, tooltip and description can be retrieved, and there is a image to display in a menu.

Parameters:
rb - ResourceBundle that label (+".label"), tip (+".tooltip") and description (+".description") are derived from.
prefix - resource properties prefix that suffixes are added to, to find label, tip and desc.
image - icon to display in menu or toolbar. can be null.

SystemBaseWizardAction

protected SystemBaseWizardAction(ResourceBundle rb,
                                 String prefix,
                                 Shell parent)
Constructor for SystemBaseWizardAction given a resource bundle from which the label, tooltip and description can be retrieved, and there is no image for this action.

Parameters:
rb - ResourceBundle that label (+".label"), tip (+".tooltip") and description (+".description") are derived from.
prefix - resource properties prefix that suffixes are added to, to find label, tip and desc.
Method Detail

setWizardTitle

public void setWizardTitle(String title)
Set the wizard title. Using this makes it possible to avoid subclassing a wizard


setWizardImage

public void setWizardImage(ImageDescriptor wizardImage)
Set the wizard image. Using this makes it possible to avoid subclassing a wizard


setWizardPageTitle

public void setWizardPageTitle(String pageTitle)
Set the wizard page title. Using this makes it possible to avoid subclassing. The page title goes below the wizard title, and can be unique per page. However, typically the wizard page title is the same for all pages... eg "Filter".

This is not used by default, but can be queried via getPageTitle() when constructing pages.


getWizardPageTitle

public String getWizardPageTitle()
Return the page title as set via setWizardPageTitle


setMinimumPageSize

public void setMinimumPageSize(int width,
                               int height)
Call this method to set the wizard's dimensions without having to subclass the wizard. If you pass zero for either value, then the default will be used for that.


createDialog

protected Dialog createDialog(Shell shell)
Override of parent's method. Does the following:

Specified by:
createDialog in class SystemBaseDialogAction
See Also:
SystemBaseDialogAction.run()

createWizard

protected abstract IWizard createWizard()
The default processing for the run method calls createDialog, which we override in this class. The implementation of createDialog calls this method that you must override, to create the wizard. The result goes into a WizardDialog which is opened and hence displayed to the user.


getDialogValue

protected Object getDialogValue(Dialog dlg)
By default, we try to get the wizard's value by calling getOutputObject()

Specified by:
getDialogValue in class SystemBaseDialogAction
Parameters:
dlg - The dialog object, after it has returned from open.

postProcessWizard

protected void postProcessWizard(IWizard wizard)
Typically, the wizard's performFinish method does the work required by a successful finish of the wizard. However, often we also want to be able to extract user-entered data from the wizard, by calling getters in this action. To enable this, override this method to populate your output instance variables from the completed wizard, which is passed as a parameter. This is only called after successful completion of the wizard.


wasCancelled

public boolean wasCancelled()
Returns true if the user cancelled the wizard. This is an override of the parent method, since we can be more accurate with wizards than we can with dialogs.

Specified by:
wasCancelled in interface ISystemDialogAction
Overrides:
wasCancelled in class SystemBaseDialogAction

Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.