Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

RSE
Release 3.0

org.eclipse.rse.ui.actions
Class SystemBaseWizardAction


java.lang.Object
  extended by 

org.eclipse.core.commands.common.EventManager
      extended by 

org.eclipse.jface.action.AbstractAction
          extended by 

org.eclipse.jface.action.Action
              extended by 

org.eclipse.rse.ui.actions.SystemBaseAction
                  extended by 

org.eclipse.rse.ui.actions.SystemBaseDialogAction
                      extended by 
org.eclipse.rse.ui.actions.SystemBaseWizardAction
All Implemented Interfaces:
IAction, ISelectionChangedListener, ISystemAction, ISystemDialogAction, ISystemWizardAction
Direct Known Subclasses:
SystemNewConnectionAction, SystemNewFilterAction

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:
  • Supports setting the label, description, image and tooltip text for this action, via constructors.
  • Sets SystemBaseAction.allowOnMultipleSelection(boolean) to false, since most wizard actions are not permitted on multiple selection.
  • Supports setting whether the wizard requires a progress-monitor or not, which is propogated to the wizard.
  • Supports setting the overall wizard title, which is propogated to the wizard.
  • Supports setting the overall wizard image, which is propogated to the wizard.
  • Supports setting the default wizard page-title, which is propogated to the wizard and the wizard pages.
  • Supports setting the wizard;s default contextual-help, which is propogated to the wizard and the wizard pages.
  • Supports setting the wizard's minimum-size, which is propogated and applied to the wizard.
  • Supports a wasCancelled() method so the caller can easily determine if the wizard was dismissed or cancelled by the user.
  • Supports propogation of the current-viewer.

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.


Field Summary
 
Fields inherited from class org.eclipse.rse.ui.actions. SystemBaseDialogAction
cancelled, dlgHelpId, needsProgressMonitor, needsProgressMonitorSet, processAll, value
 
Fields inherited from class org.eclipse.rse.ui.actions. SystemBaseAction
allowOnMultipleSelection, arrowCursor, helpId, selectionSensitive, shell, sSelection, traceSelections, traceTarget, viewer, waitCursor
 
Fields inherited from interface org.eclipse.jface.action. IAction
AS_CHECK_BOX, AS_DROP_DOWN_MENU, AS_PUSH_BUTTON, AS_RADIO_BUTTON, AS_UNSPECIFIED, CHECKED, DESCRIPTION, ENABLED, HANDLED, IMAGE, RESULT, TEXT, TOOL_TIP_TEXT
 
Constructor Summary
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   WizardDialog doCreateWizardDialog ( Shell shell, IWizard wizard)
          Creates the dialog instance.
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 org.eclipse.rse.ui.actions. SystemBaseDialogAction
getDialogHelpContextId, getNeedsProgressMonitor, getProcessAllSelections, getValue, run, setDialogHelp, setNeedsProgressMonitor, setProcessAllSelections, setValue, wasNeedsProgressMonitorSet
 
Methods inherited from class org.eclipse.rse.ui.actions. SystemBaseAction
allowOnMultipleSelection, checkObjectType, getContextMenuGroup, getCurrentTreeView, getFirstSelection, getHelpContextId, getNextSelection, getRemoteAdapter, getSelection, getSelectionProvider, getShell, getShell, getSystemConnection, getViewAdapter, getViewer, isDummy, isEnabled, isSelectionSensitive, issueTraceMessage, selectionChanged, setAvailableOffline, setBusyCursor, setContextMenuGroup, setDisplayCursor, setDisplayCursor, setHelp, setHost, setInputs, setSelection, setSelectionProvider, setSelectionSensitive, setShell, setTracing, setTracing, setViewer, updateSelection
 
Methods inherited from class org.eclipse.jface.action. Action
convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isHandled, notifyResult, removeAcceleratorText, removeMnemonics, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText
 
Methods inherited from class org.eclipse.jface.action. AbstractAction
addPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListener
 
Methods inherited from class org.eclipse.core.commands.common. EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.rse.ui.actions. ISystemDialogAction
getValue, setProcessAllSelections, setValue
 
Methods inherited from interface org.eclipse.rse.ui.actions. ISystemAction
allowOnMultipleSelection, getContextMenuGroup, getHelpContextId, getSelection, getShell, getViewer, isDummy, isSelectionSensitive, setContextMenuGroup, setHelp, setInputs, setSelection, setSelectionSensitive, setShell, setViewer
 
Methods inherited from interface org.eclipse.jface.action. IAction
addPropertyChangeListener, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isEnabled, isHandled, removePropertyChangeListener, run, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText
 
Methods inherited from interface org.eclipse.jface.viewers. ISelectionChangedListener
selectionChanged
 

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.
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 final 
Dialog createDialog(
Shell shell)
Override of parent's method. Does the following:
  • Calls abstract createWizard() method to get wizard instance
  • If wizard implements ISystemWizard, calls setInputValue(...), passing in getValue() if not null, else passing in getFirstSelection() if not null.
  • Instantiates a WizardDialog object with the wizard object from createWizard(). Returns this to run() in our parent class which then opens this dialog.

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

doCreateWizardDialog

protected 
WizardDialog doCreateWizardDialog(
Shell shell,
                                            
IWizard wizard)
Creates the dialog instance. Called from createDialog(...). Gives overrides the chance to plug-in their own specialized wizard dialog implementations.

Parameters:
shell - The shell to create the dialog in. Must be not null.
wizard - The wizard to create the wizard dialog for. Must be not null.
Returns:
The wizard dialog instance. Must be never null.

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

RSE
Release 3.0

Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire