|
RSE Release 3.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jface.wizard.Wizard
org.eclipse.rse.ui.wizards.AbstractSystemWizard
public abstract class AbstractSystemWizard
Base class for all RSE wizards. This class is more beneficial when using in conjunction with
AbstractSystemWizardPage
, and
SystemBaseWizardAction
.
A wizard is a multi-page UI, that prompts users for information and then uses that information to create something (typically). The wizard has an overall title that shows for each page, and a wizard page title that can be unique per page, but typically is not. Typically, the overall title is a verb, such as "New", while the page title expands on the verb, as in "File". There is also a description per page, which is unique and explains the purpose of that page. Further, there is a wizard image that is always the same per wizard page.
Using this base class for wizards offers the following advantages over just using the eclipse Wizard class:
SystemBaseWizardAction
,
and SystemWizardDialog
classes, propogating settings
from these to the wizard, and further propogating those to the individual wizard pages.
SystemBaseWizardAction
class, when
this wizard is launched from a subclass of that action class.
setWizardPageTitle(String)
, that all
AbstractSystemWizardPage
pages will use by default for
their title, if the non-title constructor is used for that page.
SystemWizardDialog
, supports dynamically
updating the wizard size via updateSize()
, if dynamic content is added to a wizard page, causing the page to grow beyond its initial size.
setHelp(String)
method to set the overall wizard's contextual help. This is propogated to each
AbstractSystemWizardPage
as it is added.
wasCancelled()
method so callers can easily test if the wizard was cancelled/dismissed by the user.
setMinimumPageSize(int, int)
method to set the minimum width and height of the wizard.
setPageError(IWizardPage)
method that can be called in performFinish when an error is detected on a
non-current page. This issues a message telling the user there is an error on another page.
To use this class, :
setHelp(String)
to set the overall help, if desired.
setWizardPageTitle(String)
to set the title to use for all pages, if desired.
addPages()
to add your pages
via calls to addPage(IWizardPage).
performFinish()
to do the wizard's main task when Finish is pressed. Cycle through each of your pages calling
performFinish() on each of them. If performFinish() returns false from any page, call setPageError(IWizardPage)
and
return false from your performFinish() method to cancel the Finish operation.
AbstractSystemWizardPage
,
SystemWizardDialog
,
SystemBaseWizardAction
Field Summary | |
---|---|
protected boolean |
cancelled
|
protected boolean |
finishPressed
|
protected String |
helpId
|
protected Object |
input
|
protected int |
minPageHeight
|
protected int |
minPageWidth
|
protected Object |
output
|
protected SystemWizardDialog |
owningDialog
|
protected String |
pageTitle
|
protected IStructuredSelection |
selection
|
protected Viewer |
viewer
|
Fields inherited from class org.eclipse.jface.wizard.Wizard |
---|
DEFAULT_IMAGE |
Constructor Summary | |
---|---|
AbstractSystemWizard()
Default constructor. |
|
AbstractSystemWizard(String title)
Constructor when wizard title is known. |
|
AbstractSystemWizard(String title,
ImageDescriptor wizardImage)
Constructor when you both a title and an image for this wizard. |
Method Summary | |
---|---|
void |
addPage(IWizardPage page)
Intercept of parent method so we can percolate the help id |
abstract void |
addPages()
Creates the wizard pages. |
protected ISystemTree |
getCurrentTreeView()
Return the current viewer as an ISystemTree if it is one, or null otherwise |
String |
getHelpContextId()
Return the help Id as set in setHelp(String) |
Object |
getInputObject()
For explicitly getting input object |
int |
getMinimumPageHeight()
Return the minimum page height. |
int |
getMinimumPageWidth()
Return the minimum page width. |
Object |
getOutputObject()
For explicitly getting output object after wizard is dismissed. |
SystemWizardDialog |
getSystemWizardDialog()
Return the result of setSystemWizardDialog(SystemWizardDialog) |
Viewer |
getViewer()
Get the Viewer that called this wizard. |
String |
getWizardPageTitle()
Return the page title as set via setWizardPageTitle |
void |
init(IWorkbench workbench,
IStructuredSelection selection)
Required by INewWizard interface. |
boolean |
performCancel()
Override of parent so we can record the fact the wizard was cancelled. |
abstract boolean |
performFinish()
Called when finish pressed. |
int |
publicConvertHeightInCharsToPixels(int chars)
Expose inherited protected method convertHeightInCharsToPixels as a publicly excessible method Requires setOwningDialog to have been called, else returns -1 |
int |
publicConvertWidthInCharsToPixels(int chars)
Expose inherited protected method convertWidthInCharsToPixels as a publicly excessible method Requires setOwningDialog to have been called, else returns -1 |
void |
setHelp(String id)
Set the help context Id (infoPop) for this wizard. |
void |
setInputObject(Object inputObject)
For explicitly setting input object |
void |
setMinimumPageSize(int width,
int height)
Set the wizard's min page width and height. |
void |
setOutputObject(Object outputObject)
For explicitly setting output object after wizard is dismissed. |
void |
setPageError(IWizardPage pageInError)
If in the processing of performFinish an error is detected on another page of the wizard, the best we can do is tell the user this via an error message on their own page. |
void |
setSystemWizardDialog(SystemWizardDialog dlg)
Called from SystemWizardDialog when it is used as the hosting dialog |
void |
setViewer(Viewer v)
Set the Viewer that called this wizard. |
protected void |
setWasCancelled(boolean cancelled)
You must call this in your performFinish method. |
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. |
void |
updateSize()
Exposes this nice new 2.0 capability to the public. |
boolean |
wasCancelled()
Allow caller to determine if wizard was cancelled or not. |
Methods inherited from class org.eclipse.jface.wizard.Wizard |
---|
canFinish, createPageControls, dispose, getContainer, getDefaultPageImage, getDialogSettings, getNextPage, getPage, getPageCount, getPages, getPreviousPage, getShell, getStartingPage, getTitleBarColor, getWindowTitle, isHelpAvailable, needsPreviousAndNextButtons, needsProgressMonitor, setContainer, setDefaultPageImageDescriptor, setDialogSettings, setForcePreviousAndNextButtons, setHelpAvailable, setNeedsProgressMonitor, setTitleBarColor, setWindowTitle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.jface.wizard.IWizard |
---|
canFinish, createPageControls, dispose, getContainer, getDefaultPageImage, getDialogSettings, getNextPage, getPage, getPageCount, getPages, getPreviousPage, getStartingPage, getTitleBarColor, getWindowTitle, isHelpAvailable, needsPreviousAndNextButtons, needsProgressMonitor, setContainer |
Field Detail |
---|
protected boolean finishPressed
protected boolean cancelled
protected Object input
protected Object output
protected IStructuredSelection selection
protected int minPageWidth
protected int minPageHeight
protected String helpId
protected Viewer viewer
protected String pageTitle
protected SystemWizardDialog owningDialog
Constructor Detail |
---|
public AbstractSystemWizard()
setWizardTitle(String)
,
setWizardImage(ImageDescriptor)
,
setWizardPageTitle(String)
public AbstractSystemWizard(String title)
setWizardTitle(String)
setWizardImage(ImageDescriptor)
,
setWizardPageTitle(String)
public AbstractSystemWizard(String title, ImageDescriptor wizardImage)
setWizardTitle(String)
or setWizardImage(ImageDescriptor)
setWizardPageTitle(String)
Method Detail |
---|
public void setSystemWizardDialog(SystemWizardDialog dlg)
SystemWizardDialog
when it is used as the hosting dialog
setSystemWizardDialog
in interface ISystemWizard
public SystemWizardDialog getSystemWizardDialog()
setSystemWizardDialog(SystemWizardDialog)
getSystemWizardDialog
in interface ISystemWizard
public void updateSize()
updateSize
in interface ISystemWizard
public void setWizardTitle(String title)
public void setWizardPageTitle(String pageTitle)
This is not used by default, but can be queried via getPageTitle() when constructing pages.
setWizardPageTitle
in interface ISystemWizard
public String getWizardPageTitle()
getWizardPageTitle
in interface ISystemWizard
public void setWizardImage(ImageDescriptor wizardImage)
public void setHelp(String id)
Same as #setHelp(String)
setHelp
in interface ISystemWizard
#getHelpContextId()
public String getHelpContextId()
getHelpContextId
in interface ISystemWizard
public void addPage(IWizardPage page)
addPage
in class Wizard
public void setViewer(Viewer v)
This is called for you if using a subclass of SystemBaseWizardAction
.
setViewer
in interface ISystemWizard
public Viewer getViewer()
getViewer
in interface ISystemWizard
protected ISystemTree getCurrentTreeView()
public void setInputObject(Object inputObject)
setInputObject
in interface ISystemPromptDialog
public Object getInputObject()
getInputObject
in interface ISystemPromptDialog
public Object getOutputObject()
getOutputObject
in interface ISystemPromptDialog
public void setOutputObject(Object outputObject)
setOutputObject
in interface ISystemPromptDialog
public boolean wasCancelled()
wasCancelled
in interface ISystemPromptDialog
protected void setWasCancelled(boolean cancelled)
public boolean performCancel()
performCancel
in interface IWizard
performCancel
in class Wizard
public void init(IWorkbench workbench, IStructuredSelection selection)
init
in interface IWorkbenchWizard
public void setMinimumPageSize(int width, int height)
setMinimumPageSize
in interface ISystemWizard
public int getMinimumPageWidth()
getMinimumPageWidth
in interface ISystemWizard
public int getMinimumPageHeight()
getMinimumPageHeight
in interface ISystemWizard
public void setPageError(IWizardPage pageInError)
To simplify processing, simply call this method in your wizard's performFinish if any page's performFinish returned false. Pass the failing page. If it is not the current page, this code will issue msg RSEG1240 "Error on another page" to the user.
public int publicConvertWidthInCharsToPixels(int chars)
Requires setOwningDialog to have been called, else returns -1
publicConvertWidthInCharsToPixels
in interface ISystemPromptDialog
public int publicConvertHeightInCharsToPixels(int chars)
Requires setOwningDialog to have been called, else returns -1
publicConvertHeightInCharsToPixels
in interface ISystemPromptDialog
public abstract void addPages()
addPages
in interface IWizard
addPages
in class Wizard
public abstract boolean performFinish()
Return true if no errors, false to cancel the finish operation.
Typically, you walk through each wizard page calling performFinish on it, and only return true if they all return true. If one of the pages returns false, you should call setPageError(IWizardPage), which shows a message to the user about an error pending on another page, if the given page is not the current page.
performFinish
in interface IWizard
performFinish
in class Wizard
|
RSE Release 3.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |