|
RSE Release 3.3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jface.dialogs.DialogPage
org.eclipse.jface.wizard.WizardPage
org.eclipse.rse.ui.wizards.AbstractSystemWizardPage
public abstract class 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
,
propagating 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, 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)
.
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.
WizardPage.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
Field Summary |
---|
Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider |
---|
ERROR, INFORMATION, NONE, WARNING |
Constructor Summary | |
---|---|
AbstractSystemWizardPage(IWizard 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()
Clears the currently displayed error message and redisplayes the non-error message which was active before the error message was set (if any). |
void |
clearMessage()
Clears the currently displayed message. |
abstract Control |
createContents(Composite parent)
Abstract method. |
void |
createControl(Composite parent)
Parent override. |
void |
dispose()
|
String |
getHelpContextId()
Getter method. |
protected abstract Control |
getInitialFocusControl()
Abstract method. |
Object |
getInputObject()
Getter method. |
ISystemMessageLine |
getMessageLine()
Getter method. |
SystemMessage |
getSystemErrorMessage()
Get the currently displayed error text. |
abstract boolean |
performFinish()
Abstract method. |
void |
setErrorMessage(String message)
Note: Never override this method as long the ISystemMessageLine
construct is not eliminated from RSE! |
void |
setErrorMessage(SystemMessage message)
Display the given error message. |
void |
setErrorMessage(Throwable exc)
Display the given exception as an error message. |
protected void |
setFocus(Control control)
Internal method On Finish, when an error is detected, position to the given control. |
void |
setHelp(String helpId)
Configuration method. |
void |
setInputObject(Object inputObject)
Configuration method. |
void |
setMessage(String message)
Note: Never override this method as long the ISystemMessageLine
construct is not eliminated from RSE! |
void |
setMessage(String newMessage,
int newType)
Note: Never override this method as long the ISystemMessageLine
construct is not eliminated from RSE! |
void |
setMessage(SystemMessage message)
If the message line currently displays an error, the message is stored and will be shown after a call to clearErrorMessage |
void |
setVisible(boolean visible)
Parent override. |
Methods inherited from class org.eclipse.jface.wizard.WizardPage |
---|
canFlipToNextPage, getContainer, getDialogSettings, getImage, getName, getNextPage, getPreviousPage, getShell, getWizard, isCurrentPage, isPageComplete, setDescription, setImageDescriptor, setPageComplete, setPreviousPage, setTitle, setWizard, toString |
Methods inherited from class org.eclipse.jface.dialogs.DialogPage |
---|
convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, getControl, getDescription, getDialogFontName, getErrorMessage, getFont, getMessage, getMessageType, getTitle, getToolTipText, initializeDialogUnits, isControlCreated, performHelp, setButtonLayoutData, setControl |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.eclipse.rse.ui.messages.ISystemMessageLine |
---|
getErrorMessage, getMessage |
Methods inherited from interface org.eclipse.jface.dialogs.IDialogPage |
---|
getControl, getDescription, getErrorMessage, getMessage, getTitle, performHelp |
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(IWizard 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.
setHelp
in interface ISystemWizardPage
#getHelpContextId()
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
WizardPage.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 dispose()
dispose
in interface IDialogPage
dispose
in class DialogPage
public void createControl(Composite parent)
createContents(Composite)
, which this calls.
createControl
in interface IDialogPage
protected void applyMnemonics(Composite c)
c
- the composite.public void setVisible(boolean visible)
setVisible
in interface IDialogPage
setVisible
in class DialogPage
public void clearErrorMessage()
ISystemMessageLine
clearErrorMessage
in interface ISystemMessageLine
public void clearMessage()
ISystemMessageLine
clearMessage
in interface ISystemMessageLine
public SystemMessage getSystemErrorMessage()
ISystemMessageLine
getSystemErrorMessage
in interface ISystemMessageLine
null
is returned.public void setErrorMessage(SystemMessage message)
ISystemMessageLine
setErrorMessage
in interface ISystemMessageLine
public void setErrorMessage(Throwable exc)
ISystemMessageLine
setErrorMessage
in interface ISystemMessageLine
public void setMessage(SystemMessage message)
ISystemMessageLine
setMessage
in interface ISystemMessageLine
public void setErrorMessage(String message)
ISystemMessageLine
construct is not eliminated from RSE! Overriding does lead easely to StackOverflowError
s
if the subclass implementation does call the wrong methods!
setErrorMessage
in interface ISystemMessageLine
setErrorMessage
in class WizardPage
WizardPage.setErrorMessage(java.lang.String)
public void setMessage(String newMessage, int newType)
ISystemMessageLine
construct is not eliminated from RSE! Overriding does lead easily to StackOverflowError
s
if the subclass implementation does call the wrong methods!
setMessage
in class WizardPage
WizardPage.setMessage(java.lang.String, int)
public void setMessage(String message)
ISystemMessageLine
construct is not eliminated from RSE! Overriding does lead easily to StackOverflowError
s
if the subclass implementation does call the wrong methods!
setMessage
in interface ISystemMessageLine
setMessage
in class DialogPage
DialogPage.setMessage(java.lang.String)
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)
|
RSE Release 3.3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |