|
Remote Systems v6.4.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectWizardPage
com.ibm.etools.systems.core.ui.wizards.AbstractSystemWizardPage
Abstract class for system wizards pages. Using this class is most effective when used in
conjunction with AbstractSystemWizard
.
Using this base class for wizards offers the following advantages over just using the eclipse WizardPage class:
AbstractSystemWizard
,
propogating settings from the wizard to the individual wizard pages.
AbstractSystemWizard.setWizardPageTitle(String)
,
if no title specified in the constructor.
setHelp(String)
method to set the wizard page's overall contextual help
ISystemMessageLine
so supports setting error messages as
either strings or, preferably, com.ibm.etools.systems.core.ui.messages.SystemMessage
objects.
input-object
, as passed from the wizard, which in turn is passed from the action.
addSeparatorLine(Composite,int)
,
addFillerLine(Composite,int)
and addGrowableFillerLine(Composite,int)
.
setBusyCursor(boolean)
method to toggle the cursor between busy and normal
To use this class, :
setHelp(String)
to set the contextual help for this page. Or, just use the default help
set via AbstractSystemWizard.setHelp(String)
in the wizard itself.
createContents(Composite)
to populate the client area. You may find it useful to use the static methods in SystemWidgetHelpers
.
getInitialFocusControl()
to return the control to gain initial focus on this page, or null if there are no input controls.
performFinish()
to perform input validation when Finish is pressed. Return true if validated ok, false if not.
#isPageComplete()
to return false if any required inputs are not given. Typically, this also is coded to
return false if there is an error message showing, which you detect by maintaining a SystemMessage instance variable, set or cleared by your
keystroke validator methods, and performFinish validation routine.
For error validation when there are multiple input fields on the page, there are two different approaches you can take:
There is no consensus on the approach, although clearly the second one is preferable when it is possible.
AbstractSystemWizard
,
SystemWizardDialog
,
SystemBaseWizardAction
,
Serialized FormField Summary | |
---|---|
static String |
copyright
|
Constructor Summary | |
---|---|
AbstractSystemWizardPage(ISystemWizard wizard,
String pageName,
String pageDescription)
Constructor when the overall wizard page title is desired, as specified in AbstractSystemWizard.setWizardPageTitle(String) .
|
|
AbstractSystemWizardPage(IWizard wizard,
String pageName,
String pageTitle,
String pageDescription)
Constructor when a unique page title is desired. |
Method Summary | |
---|---|
protected void |
addFillerLine(Composite parent,
int nbrColumns)
Helper method Add a spacer line |
protected void |
addGrowableFillerLine(Composite parent,
int nbrColumns)
Helper method Add a spacer line that grows in height to absorb extra space |
protected void |
addSeparatorLine(Composite parent,
int nbrColumns)
Helper method Add a separator line. |
protected void |
applyMnemonics(Composite c)
Apply mnemonic to the content composite. |
void |
clearErrorMessage()
ISystemMessageLine method. |
void |
clearMessage()
ISystemMessageLine method. |
abstract Control |
createContents(Composite parent)
Abstract method. |
void |
createControl(Composite parent)
Parent override. |
String |
getHelpContextId()
Getter method. |
protected abstract Control |
getInitialFocusControl()
Abstract method. |
Object |
getInputObject()
Getter method. |
ISystemMessageLine |
getMessageLine()
Getter method. |
SystemMessage |
getSystemErrorMessage()
ISystemMessageLine method. |
abstract boolean |
performFinish()
Abstract method. |
void |
setBusyCursor(boolean setBusy)
Set the cursor to the wait cursor (true) or restores it to the normal cursor (false). |
void |
setErrorMessage(String message)
ISystemMessageLine method. |
void |
setErrorMessage(SystemMessage message)
ISystemMessageLine method. |
void |
setErrorMessage(Throwable exc)
ISystemMessageLine method. |
protected void |
setFocus(Control control)
Internal method On Finish, when an error is detected, position to the given control. |
void |
setHelp(Control c,
String helpId)
Configuration method. |
void |
setHelp(String helpId)
Configuration method. |
void |
setInputObject(Object inputObject)
Configuration method. |
void |
setMessage(String message)
ISystemMessageLine method. |
void |
setMessage(SystemMessage message)
ISystemMessageLine method. |
void |
setVisible(boolean visible)
Parent override. |
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.messages.ISystemMessageLine |
---|
getErrorMessage, getMessage |
Field Detail |
public static final String copyright
Constructor Detail |
public AbstractSystemWizardPage(IWizard wizard, String pageName, String pageTitle, String pageDescription)
wizard
- - the page wizard.pageName
- - the untranslated ID of this page. Not really used.pageTitle
- - the translated title of this page. Appears below the overall wizard title.pageDescription
- - the translated description of this page. Appears to the right of the page title.public AbstractSystemWizardPage(ISystemWizard wizard, String pageName, String pageDescription)
AbstractSystemWizard.setWizardPageTitle(String)
.
It is a somewhat common design pattern to use the same title for all pages in a wizard, and this makes it easy to do that.
Your wizard must extend AbstractSystemWizard, and you must have called setWizardPageTitle.
wizard
- - the page's wizard.pageName
- - the untranslated ID of this page. Not really used.pageDescription
- - the translated description of this page. Appears to the right of the page title.Method Detail |
public void setHelp(String helpId)
This id is stored, and then applied to each of the input-capable controls in the main composite returned from createContents.
Call this first to set the default help, then call setHelp(Control, String)
per individual
control if control-unique help is desired.
setHelp
in interface ISystemWizardPage
#getHelpContextId()
public void setHelp(Control c, String helpId)
This overrides the default set in the call to setHelp(String)
.
public void setInputObject(Object inputObject)
setInputObject
in interface ISystemWizardPage
public Object getInputObject()
getInputObject
in interface ISystemWizardPage
public String getHelpContextId()
setHelp(String)
getHelpContextId
in interface ISystemWizardPage
public ISystemMessageLine getMessageLine()
public abstract Control createContents(Composite parent)
You may find it useful to use the static methods in SystemWidgetHelpers
.
If you do keystroke validation, you should call setErrorMessage(SystemMessage)
if you detect errors, and also
#setPageComplete(boolean)
to affect the enablement of the next and finish buttons.
SystemWidgetHelpers
protected abstract Control getInitialFocusControl()
Child classes must override this, but can return null.
public abstract boolean performFinish()
Called by the main wizard when the user presses Finish. The operation will be cancelled if this method returns false for any page.
performFinish
in interface ISystemWizardPage
public void createControl(Composite parent)
createContents(Composite)
, which this calls.
protected void applyMnemonics(Composite c)
c
- the composite.public void setVisible(boolean visible)
public void clearErrorMessage()
clearErrorMessage
in interface ISystemMessageLine
public void clearMessage()
clearMessage
in interface ISystemMessageLine
public SystemMessage getSystemErrorMessage()
getSystemErrorMessage
in interface ISystemMessageLine
null
is returned.public void setErrorMessage(SystemMessage message)
setErrorMessage
in interface ISystemMessageLine
public void setErrorMessage(Throwable exc)
setErrorMessage
in interface ISystemMessageLine
public void setErrorMessage(String message)
setErrorMessage
in interface ISystemMessageLine
public void setMessage(SystemMessage message)
setMessage
in interface ISystemMessageLine
public void setMessage(String message)
setMessage
in interface ISystemMessageLine
public void setBusyCursor(boolean setBusy)
protected void addSeparatorLine(Composite parent, int nbrColumns)
protected void addFillerLine(Composite parent, int nbrColumns)
protected void addGrowableFillerLine(Composite parent, int nbrColumns)
protected void setFocus(Control control)
|
Remote Systems v6.4.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |