|
Remote Systems v6.4.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jface.dialogs.Dialog
com.ibm.etools.systems.core.ui.dialogs.SystemPromptDialog
Base dialog class. Use this whenever more than a simple string prompt is needed (which InputDialog gives you).
By default we configure the dialog as modal. If you do not want this, call setBlockOnOpen(false) after instantiating.
This base class offers the following ease-of-use features:
wasCancelled()
method so callers can easily determine how user exited the dialog
setNeedsProgressMonitor(boolean)
setBusyCursor(boolean)
method to toggle the cursor between busy and normal
To use this class:
setHelp(String)
to set the dialog's help in the constructor.
createInner(Composite)
to populate the contents
processOK()
to process the pressing of the OK button
For error checking, add modify listeners to entry fields and if needed selection listeners to buttons, then in your event handler
setErrorMessage(SystemMessage)
to display an error if detected. Pass null to clear previous error.
setPageComplete(boolean)
with true if there are no errors and all required data is supplied. This enables/disables OK.
AbstractSystemWizardPage
apply here.
Field Summary | |
---|---|
protected long |
activeRunningOperations
|
protected static boolean |
ADD_BUTTON_NO
|
protected static boolean |
ADD_BUTTON_YES
|
protected static int |
ADD_ID
|
protected Button |
addButton
|
protected Cursor |
arrowCursor
|
protected static boolean |
BROWSE_BUTTON_NO
|
protected static boolean |
BROWSE_BUTTON_YES
|
protected static int |
BROWSE_ID
|
protected Button |
browseButton
|
protected Composite |
buttonsComposite
|
protected Button |
cancelButton
|
protected SelectionAdapter |
cancelListener
|
static String |
copyright
|
protected static boolean |
DETAILS_BUTTON_NO
|
protected static boolean |
DETAILS_BUTTON_YES
|
protected static int |
DETAILS_ID
|
protected Button |
detailsButton
|
protected boolean |
detailsButtonHideMode
|
protected String |
detailsHideLabel
|
protected String |
detailsShowLabel
|
protected Composite |
dialogAreaComposite
|
protected Mnemonics |
dialogMnemonics
|
protected SystemMessageLine |
fMessageLine
|
protected String |
helpId
|
protected int |
horizontalSpacing
|
protected boolean |
initialAddButtonEnabledState
|
protected boolean |
initialDetailsButtonEnabledState
|
protected boolean |
initialOKButtonEnabledState
|
protected Object |
inputObject
|
protected String |
labelAdd
|
protected String |
labelBrowse
|
protected String |
labelCancel
|
protected String |
labelDetailsHide
|
protected String |
labelDetailsShow
|
protected String |
labelOk
|
protected String |
labelTest
|
protected int |
marginHeight
|
protected int |
marginWidth
|
protected int |
minHeight
|
protected int |
minWidth
|
protected boolean |
needsProgressMonitor
|
protected Button |
okButton
|
protected boolean |
okPressed
|
protected boolean |
operationCancelableState
|
protected Object |
outputObject
|
protected ISystemValidator |
outputObjectValidator
|
protected Shell |
overallShell
|
protected boolean |
pack
|
protected Composite |
parentComposite
|
protected SystemMessage |
pendingErrorMessage
|
protected SystemMessage |
pendingMessage
|
protected ProgressMonitorPart |
progressMonitorPart
|
protected boolean |
showAddButton
|
protected boolean |
showBrowseButton
|
protected boolean |
showDetailsButton
|
protected boolean |
showOkButton
|
protected boolean |
showTestButton
|
protected static boolean |
TEST_BUTTON_NO
|
protected static boolean |
TEST_BUTTON_YES
|
protected static int |
TEST_ID
|
protected Button |
testButton
|
protected String |
tipAdd
|
protected String |
tipBrowse
|
protected String |
tipCancel
|
protected String |
tipDetailsHide
|
protected String |
tipDetailsShow
|
protected String |
tipOk
|
protected String |
tipTest
|
protected String |
title
|
protected Image |
titleImage
|
protected int |
verticalSpacing
|
protected Cursor |
waitCursor
|
protected MessageDialog |
windowClosingDialog
|
Constructor Summary | |
---|---|
SystemPromptDialog(Shell shell,
String title)
Constructor one: ok and cancel buttons |
|
SystemPromptDialog(Shell shell,
String title,
Image titleImage)
Constructor two: ok and cancel buttons and an icon for the dialog title area |
|
SystemPromptDialog(Shell shell,
String title,
Object inputObject,
boolean browse)
Constructor five: ok, browse and cancel buttons, plus explicit setting of input object |
|
SystemPromptDialog(Shell shell,
String title,
Object inputObject,
boolean browse,
boolean test,
Image titleImage)
Constructor six: an input object. true/false for browse button, true/false for test button, a title image |
|
SystemPromptDialog(Shell shell,
String title,
Object inputObject,
boolean browse,
Image titleImage)
Constructor six: ok, browse and cancel buttons, plus explicit setting of input object and an icon for the dialog title area |
Method Summary | |
---|---|
protected Object |
aboutToStart(boolean enableCancelButton)
About to start a long running operation tiggered through the dialog. |
protected Label |
addFillerLine(Composite parent,
int nbrColumns)
Add a spacer line |
protected Label |
addGrowableFillerLine(Composite parent,
int nbrColumns)
Add a spacer line that grows in height to absorb extra space |
protected Label |
addSeparatorLine(Composite parent,
int nbrColumns)
Add a separator line. |
protected void |
adjustButtonWidth(Button button)
Adjust the width hint of a button to account for the presumed addition of a mnemonic. |
protected void |
applyMnemonics(Mnemonics mnemonics,
Composite c)
Apply mnemonic to the composite. |
protected void |
buttonPressed(int buttonId)
Override of parent method. |
void |
clearErrorMessage()
Clears the currently displayed error message and redisplayes the message which was active before the error message was set. |
void |
clearMessage()
Clears the currently displayed message. |
boolean |
close()
|
protected void |
configureShell(Shell shell)
|
protected Control |
createButtonBar(Composite parent)
Intercept of parent, so we can create the msg line above the button bar. |
protected void |
createButtonsForButtonBar(Composite parent)
Add buttons to the dialog's button bar. |
protected Control |
createContents(Composite parent)
Override of parent. |
void |
createControl(Composite parent)
|
protected Control |
createDialogArea(Composite parent)
Called by parent. |
protected abstract Control |
createInner(Composite parent)
Called by createContents method. |
protected ISystemMessageLine |
createMessageLine(Composite c)
Create message line. |
protected MessageDialog |
createWizardClosingDialog()
Creates and returns a new wizard closing dialog without openiong it. |
void |
dispose()
|
void |
enableAddButton(boolean enable)
For explicitly enabling/disabling Add button. |
void |
enableBrowseButton(boolean enable)
For explicitly enabling/disabling Browse button. |
void |
enableCancelButton(boolean enable)
For explicitly enabling/disabling cancel button. |
void |
enableDetailsButton(boolean enable)
For explicitly enabling/disabling Details button. |
void |
enableOkButton(boolean enable)
For explicitly enabling/disabling ok button. |
void |
enableTestButton(boolean enable)
For explicitly enabling/disabling Test button. |
Button |
getAddButton()
Return Add button widget |
Button |
getBrowseButton()
Return browse button widget |
Button |
getCancelOrCloseButton()
Return cancel button widget. |
Control |
getControl()
|
String |
getDescription()
|
Button |
getDetailsButton()
Return Details button widget |
Mnemonics |
getDialogMnemonics()
Get the list of all unique mnemonics used by buttons on this dialog. |
String |
getErrorMessage()
Get the currently displayed error text. |
String |
getHelpContextId()
For retrieving the help Id |
Image |
getImage()
|
protected abstract Control |
getInitialFocusControl()
Return the Control to be given initial focus. |
Object |
getInputObject()
For explicitly getting input object |
String |
getMessage()
Get the currently displayed message. |
ISystemMessageLine |
getMessageLine()
Get the ISystemMessageLine control reference. |
Button |
getOkButton()
Return ok button widget |
Object |
getOutputObject()
For explicitly getting output object after dialog is dismissed. |
ICellEditorValidator |
getOutputObjectValidator()
Return the output object validator |
protected IProgressMonitor |
getProgressMonitor()
Returns the progress monitor for this dialog (if it has one). |
SystemMessage |
getSystemErrorMessage()
Get the currently displayed error text. |
Button |
getTestButton()
Return test button widget |
String |
getTitle()
Get the dialog's title |
void |
handleEvent(Event e)
Handles events generated by controls on this page. |
protected boolean |
hardClose()
Closes this window. |
protected boolean |
okToClose()
Checks whether it is alright to close this wizard dialog and perform standard cancel processing. |
protected void |
pack()
Deprecated. |
void |
performHelp()
|
protected boolean |
processAdd()
To be overridden by children. |
protected boolean |
processBrowse()
To be overridden by children. |
protected boolean |
processCancel()
To be overridden by children. |
protected boolean |
processDetails(boolean hideMode)
To be overridden by children. |
protected boolean |
processOK()
To be overridden by children. |
protected boolean |
processTest()
To be overridden by children. |
int |
publicConvertHeightInCharsToPixels(int chars)
Expose inherited protected method convertHeightInCharsToPixels as a publicly excessible method |
int |
publicConvertWidthInCharsToPixels(int chars)
Expose inherited protected method convertWidthInCharsToPixels as a publicly excessible method |
protected void |
restoreEnableState(Control w,
Map h,
String key)
Restores the enabled/disabled state of the given control. |
protected void |
restoreUIState(Map state)
Restores the enabled/disabled state of the wizard dialog's buttons and the tree of controls for the currently showing page. |
void |
run()
For asynch exec we defer some operations until other pending events are processed. |
void |
run(boolean fork,
boolean cancelable,
IRunnableWithProgress runnable)
For IRunnableContext. |
protected void |
saveEnableStateAndSet(Control w,
Map h,
String key,
boolean enabled)
Saves the enabled/disabled state of the given control in the given map, which must be modifiable. |
protected Map |
saveUIState(boolean keepCancelEnabled)
Captures and returns the enabled/disabled state of the wizard dialog's buttons and the tree of controls for the currently showing page. |
void |
setAddButtonLabel(String label)
For explicitly setting Add button label |
void |
setAddButtonToolTipText(String tip)
For explicitly setting Add button tooltip text |
void |
setBrowseButtonLabel(String label)
For explicitly setting browse button label |
void |
setBrowseButtonToolTipText(String tip)
For explicitly setting Browse button tooltip text |
void |
setBusyCursor(boolean setBusy)
Set the cursor to the wait cursor (true) or restores it to the normal cursor (false). |
void |
setCancelButtonLabel(String label)
For explicitly setting cancel button label |
void |
setCancelButtonToolTipText(String tip)
For explicitly setting cancel button tooltip text |
void |
setControl(Control c)
|
void |
setDescription(String description)
|
void |
setDetailsButtonLabel(String showLabel,
String hideLabel)
For explicitly setting Details button label |
void |
setDetailsButtonToolTipText(String showTip,
String hideTip)
For explicitly setting Details button tooltip text |
protected void |
setDisplayCursor(Cursor c)
Sets the given cursor for all shells currently active for this window's display. |
static void |
setDisplayCursor(Shell shell,
Cursor c)
Sets the given cursor for all shells currently active for the given shell's display. |
void |
setErrorMessage(String message)
Display the given error message. |
void |
setErrorMessage(SystemMessage message)
Display the given error message. |
void |
setErrorMessage(Throwable exc)
Convenience method to set an error message from an exception |
void |
setHelp(Control c,
String helpId)
For setting control-specific help for a control on the wizard page. |
void |
setHelp(String helpId)
For setting the default overall help for the dialog. |
void |
setImageDescriptor(ImageDescriptor id)
|
void |
setInitialOKButtonEnabledState(boolean enabled)
Set initial enabled state of ok button. |
void |
setInputObject(Object inputObject)
For explicitly setting input object. |
void |
setMessage(String message)
Set the message text. |
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 |
setMinimumSize(int width,
int height)
Set minimum width and height for this dialog. |
void |
setNeedsProgressMonitor(boolean needs)
Specify if a progress monitor is desired in this dialog. |
void |
setOkButtonLabel(String label)
For explicitly setting ok button label |
void |
setOkButtonToolTipText(String tip)
For explicitly setting ok button tooltip text |
protected SystemMessage |
setOutputObject(Object outputObject)
For explicitly setting output object. |
void |
setOutputObjectValidator(ISystemValidator outputObjectValidator)
If validation of the output object is desired, set the validator here. |
void |
setPageComplete(boolean complete)
Call this to disable the Apply button if the input is not complete or not valid. |
void |
setShowAddButton(boolean show)
Explicitly specify if Add Button to be shown |
void |
setShowBrowseButton(boolean show)
Explicitly specify if Browse Button to be shown |
void |
setShowDetailsButton(boolean show,
boolean hideMode)
Explicitly specify if Details Button to be shown. |
void |
setShowOkButton(boolean showOk)
Disable showing of Ok button |
void |
setShowTestButton(boolean show)
Explicitly specify if Test Button to be shown |
void |
setTestButtonLabel(String label)
For explicitly setting test button label |
void |
setTestButtonToolTipText(String tip)
For explicitly setting Test button tooltip text |
void |
setTitle(String title)
Set the dialog's title |
void |
setVisible(boolean visible)
|
boolean |
wasCancelled()
Allow caller to determine if window was cancelled or not. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String copyright
protected boolean okPressed
protected boolean showBrowseButton
protected boolean showTestButton
protected boolean showAddButton
protected boolean showDetailsButton
protected boolean pack
protected boolean initialOKButtonEnabledState
protected boolean initialAddButtonEnabledState
protected boolean initialDetailsButtonEnabledState
protected boolean detailsButtonHideMode
protected boolean showOkButton
protected Shell overallShell
protected Composite parentComposite
protected Composite dialogAreaComposite
protected Composite buttonsComposite
protected Button okButton
protected Button cancelButton
protected Button testButton
protected Button browseButton
protected Button addButton
protected Button detailsButton
protected String title
protected String labelOk
protected String labelBrowse
protected String labelTest
protected String labelCancel
protected String labelAdd
protected String labelDetailsShow
protected String labelDetailsHide
protected String tipOk
protected String tipBrowse
protected String tipTest
protected String tipCancel
protected String tipAdd
protected String tipDetailsShow
protected String tipDetailsHide
protected String detailsShowLabel
protected String detailsHideLabel
protected String helpId
protected Image titleImage
protected Object inputObject
protected Object outputObject
protected SystemMessageLine fMessageLine
protected SystemMessage pendingMessage
protected SystemMessage pendingErrorMessage
protected int minWidth
protected int minHeight
protected int marginWidth
protected int marginHeight
protected int verticalSpacing
protected int horizontalSpacing
protected Mnemonics dialogMnemonics
protected ISystemValidator outputObjectValidator
protected long activeRunningOperations
protected boolean operationCancelableState
protected boolean needsProgressMonitor
protected ProgressMonitorPart progressMonitorPart
protected Cursor waitCursor
protected Cursor arrowCursor
protected MessageDialog windowClosingDialog
protected SelectionAdapter cancelListener
protected static final int BROWSE_ID
protected static final int TEST_ID
protected static final int ADD_ID
protected static final int DETAILS_ID
protected static final boolean BROWSE_BUTTON_YES
protected static final boolean BROWSE_BUTTON_NO
protected static final boolean TEST_BUTTON_YES
protected static final boolean TEST_BUTTON_NO
protected static final boolean ADD_BUTTON_YES
protected static final boolean ADD_BUTTON_NO
protected static final boolean DETAILS_BUTTON_YES
protected static final boolean DETAILS_BUTTON_NO
Constructor Detail |
public SystemPromptDialog(Shell shell, String title)
shell
- - parent window this dialog is modal to.title
- - the title for the dialog. Typically translated.setInputObject(Object)
public SystemPromptDialog(Shell shell, String title, Image titleImage)
shell
- - parent window this dialog is modal to.title
- - the title for the dialog. Typically translated.titleImage
- - the icon for the dialog's title area.setInputObject(Object)
public SystemPromptDialog(Shell shell, String title, Object inputObject, boolean browse)
shell
- - parent window this dialog is modal to.title
- - the title for the dialog. Typically translated.inputObject
- - the contextual input data, which can be queried via getInputObject()
.browse
- - true if to show a Browse button, false if no Browse button desired.public SystemPromptDialog(Shell shell, String title, Object inputObject, boolean browse, Image titleImage)
shell
- - parent window this dialog is modal to.title
- - the title for the dialog. Typically translated.inputObject
- - the contextual input data, which can be queried via getInputObject()
.browse
- - true if to show a Browse button, false if no Browse button desired.titleImage
- - the icon for the dialog's title area.public SystemPromptDialog(Shell shell, String title, Object inputObject, boolean browse, boolean test, Image titleImage)
Method Detail |
protected void configureShell(Shell shell)
public void setNeedsProgressMonitor(boolean needs)
getProgressMonitor()
.
Support is patterned after WizardDialog in JFace.
public void setHelp(String helpId)
setHelp(Control, String)
.
public String 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 ISystemPromptDialog
public Object getInputObject()
getInputObject
in interface ISystemPromptDialog
public Object getOutputObject()
getOutputObject
in interface ISystemPromptDialog
public boolean wasCancelled()
wasCancelled
in interface ISystemPromptDialog
public void setOutputObjectValidator(ISystemValidator outputObjectValidator)
public ICellEditorValidator getOutputObjectValidator()
public ISystemMessageLine getMessageLine()
protected SystemMessage setOutputObject(Object outputObject)
public void setBusyCursor(boolean setBusy)
public void setShowOkButton(boolean showOk)
public void setOkButtonLabel(String label)
public void setOkButtonToolTipText(String tip)
public void enableOkButton(boolean enable)
public Button getOkButton()
public void setInitialOKButtonEnabledState(boolean enabled)
protected boolean processOK()
public void setCancelButtonLabel(String label)
public void setCancelButtonToolTipText(String tip)
public void enableCancelButton(boolean enable)
public Button getCancelOrCloseButton()
protected boolean processCancel()
public void setShowBrowseButton(boolean show)
public void setBrowseButtonLabel(String label)
public void setBrowseButtonToolTipText(String tip)
public void enableBrowseButton(boolean enable)
public Button getBrowseButton()
protected boolean processBrowse()
public void setShowTestButton(boolean show)
public void setTestButtonLabel(String label)
public void setTestButtonToolTipText(String tip)
public void enableTestButton(boolean enable)
public Button getTestButton()
protected boolean processTest()
public void setShowAddButton(boolean show)
public void setAddButtonLabel(String label)
public void setAddButtonToolTipText(String tip)
public void enableAddButton(boolean enable)
public Button getAddButton()
protected boolean processAdd()
public void setShowDetailsButton(boolean show, boolean hideMode)
public void setDetailsButtonLabel(String showLabel, String hideLabel)
public void setDetailsButtonToolTipText(String showTip, String hideTip)
public void enableDetailsButton(boolean enable)
public Button getDetailsButton()
protected boolean processDetails(boolean hideMode)
Note the text is automatically toggled for you! You need only do whatever the functionality is that you desire
hideMode
- the current state of the details toggle, prior to this request. If you return true from
this method, this state and the button text will be toggled.
public Mnemonics getDialogMnemonics()
protected ISystemMessageLine createMessageLine(Composite c)
public void run()
run
in interface Runnable
public void handleEvent(Event e)
protected void pack()
protected abstract Control createInner(Composite parent)
protected abstract Control getInitialFocusControl()
protected void buttonPressed(int buttonId)
protected Control createButtonBar(Composite parent)
protected void adjustButtonWidth(Button button)
button
- the button whose width is to be adjusted.protected void createButtonsForButtonBar(Composite parent)
parent
- the button bar compositepublic void setMinimumSize(int width, int height)
protected Control createContents(Composite parent)
protected void applyMnemonics(Mnemonics mnemonics, Composite c)
c
- the composite.protected Control createDialogArea(Composite parent)
public void setPageComplete(boolean complete)
protected Label addSeparatorLine(Composite parent, int nbrColumns)
protected Label addFillerLine(Composite parent, int nbrColumns)
protected Label addGrowableFillerLine(Composite parent, int nbrColumns)
public int publicConvertWidthInCharsToPixels(int chars)
publicConvertWidthInCharsToPixels
in interface ISystemPromptDialog
public int publicConvertHeightInCharsToPixels(int chars)
publicConvertHeightInCharsToPixels
in interface ISystemPromptDialog
public void clearErrorMessage()
clearErrorMessage
in interface ISystemMessageLine
public void clearMessage()
clearMessage
in interface ISystemMessageLine
public String getErrorMessage()
getErrorMessage
in interface ISystemMessageLine
null
is returned.public SystemMessage getSystemErrorMessage()
getSystemErrorMessage
in interface ISystemMessageLine
null
is returned.public String getMessage()
getMessage
in interface ISystemMessageLine
null is returned.
public void setErrorMessage(String message)
setErrorMessage
in interface ISystemMessageLine
public void setErrorMessage(SystemMessage message)
setErrorMessage
in interface ISystemMessageLine
public void setMessage(String message)
setMessage
in interface ISystemMessageLine
public void setMessage(SystemMessage message)
setMessage
in interface ISystemMessageLine
public void setErrorMessage(Throwable exc)
setErrorMessage
in interface ISystemMessageLine
public void setDescription(String description)
public String getDescription()
public Image getImage()
public void performHelp()
public void setVisible(boolean visible)
public void dispose()
public Control getControl()
public void setControl(Control c)
public void createControl(Composite parent)
public void setImageDescriptor(ImageDescriptor id)
public String getTitle()
public void setTitle(String title)
protected IProgressMonitor getProgressMonitor()
null
if
this dialog does not have oneprotected Object aboutToStart(boolean enableCancelButton)
enableCancelButton
- true
if the Cancel button should
be enabled, and false
if it should be disabled
protected MessageDialog createWizardClosingDialog()
public boolean close()
protected boolean okToClose()
true
if it is alright to close this dialog, and
false
if it is notprotected boolean hardClose()
true
if the window is (or was already) closed,
and false
if it is still openprotected void restoreEnableState(Control w, Map h, String key)
w
- the controlh
- the map (key type: String
, element type:
Boolean
)key
- the keysaveEnableStateAndSet(Control, java.util.Map, java.lang.String, boolean)
protected void restoreUIState(Map state)
state
- a map containing the saved state as returned by
saveUIState
saveUIState(boolean)
protected Map saveUIState(boolean keepCancelEnabled)
keepCancelEnabled
- true
if the Cancel button should
remain enabled, and false
if it should be disabled
restoreUIState
restoreUIState(java.util.Map)
protected void saveEnableStateAndSet(Control w, Map h, String key, boolean enabled)
w
- the control, or null
if noneh
- the map (key type: String
, element type:
Boolean
)key
- the keyenabled
- true
to enable the control,
and false
to disable itrestoreEnableState(Control,Map,String)
protected void setDisplayCursor(Cursor c)
c
- the cursorpublic static void setDisplayCursor(Shell shell, Cursor c)
c
- the cursorpublic void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException
InvocationTargetException
InterruptedException
|
Remote Systems v6.4.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |