Remote Systems
v6.4.1

com.ibm.etools.systems.core.ui.dialogs
Class SystemPromptDialog

java.lang.Object
  extended byorg.eclipse.jface.dialogs.Dialog
      extended bycom.ibm.etools.systems.core.ui.dialogs.SystemPromptDialog
All Implemented Interfaces:
ISystemMessageLine, ISystemPromptDialog, Runnable
Direct Known Subclasses:
EnvironmentVariablesPromptDialog, RemoteSourceContainerSelectionDialog, SystemChangeFilterDialog, SystemCommandAction.CommandDialog, SystemCopyProfileDialog, SystemDeleteDialog, SystemDownloadConflictAction.DownloadConflictDialog, SystemFilterTableDialog, SystemFilterWorkWithFilterPoolsDialog, SystemNewCompileSrcTypeDialog, SystemPasswordPersistancePrompt, SystemPasswordPromptDialog, SystemPromptCommandDialog, SystemPromptForHomeFolderDialog, SystemRenameDialog, SystemRenameSingleDialog, SystemSelectAnythingDialog, SystemSelectConnectionDialog, SystemSelectFileTypesDialog, SystemSelectRemoteFileOrFolderDialog, SystemSimpleCopyDialog, SystemSimpleSelectDialog, SystemTestFilterStringDialog, SystemUnNamedFilterDialog, SystemUpdateConnectionDialog, SystemUserIdPerSystemTypeDialog, SystemWorkWithCompileCommandsDialog, SystemWorkWithHistoryDialog, SystemWorkWithUDAsDialog, SystemWorkWithUDTypeDialog, UniversalClasspathEntryPromptDialog

public abstract class SystemPromptDialog
extends Dialog
implements ISystemPromptDialog, ISystemMessageLine, Runnable

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:

To use this class:

  1. Subclass it, specifying the dialog title in the constructor. Optionally, also call setHelp(String) to set the dialog's help in the constructor.
  2. Override createInner(Composite) to populate the contents
  3. Override 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

  1. Call setErrorMessage(SystemMessage) to display an error if detected. Pass null to clear previous error.
  2. Call setPageComplete(boolean) with true if there are no errors and all required data is supplied. This enables/disables OK.
  3. The same two error-reporting strategies described in AbstractSystemWizardPage apply here.

See Also:
Serialized Form

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

copyright

public static final String copyright
See Also:
Constant Field Values

okPressed

protected boolean okPressed

showBrowseButton

protected boolean showBrowseButton

showTestButton

protected boolean showTestButton

showAddButton

protected boolean showAddButton

showDetailsButton

protected boolean showDetailsButton

pack

protected boolean pack

initialOKButtonEnabledState

protected boolean initialOKButtonEnabledState

initialAddButtonEnabledState

protected boolean initialAddButtonEnabledState

initialDetailsButtonEnabledState

protected boolean initialDetailsButtonEnabledState

detailsButtonHideMode

protected boolean detailsButtonHideMode

showOkButton

protected boolean showOkButton

overallShell

protected Shell overallShell

parentComposite

protected Composite parentComposite

dialogAreaComposite

protected Composite dialogAreaComposite

buttonsComposite

protected Composite buttonsComposite

okButton

protected Button okButton

cancelButton

protected Button cancelButton

testButton

protected Button testButton

browseButton

protected Button browseButton

addButton

protected Button addButton

detailsButton

protected Button detailsButton

title

protected String title

labelOk

protected String labelOk

labelBrowse

protected String labelBrowse

labelTest

protected String labelTest

labelCancel

protected String labelCancel

labelAdd

protected String labelAdd

labelDetailsShow

protected String labelDetailsShow

labelDetailsHide

protected String labelDetailsHide

tipOk

protected String tipOk

tipBrowse

protected String tipBrowse

tipTest

protected String tipTest

tipCancel

protected String tipCancel

tipAdd

protected String tipAdd

tipDetailsShow

protected String tipDetailsShow

tipDetailsHide

protected String tipDetailsHide

detailsShowLabel

protected String detailsShowLabel

detailsHideLabel

protected String detailsHideLabel

helpId

protected String helpId

titleImage

protected Image titleImage

inputObject

protected Object inputObject

outputObject

protected Object outputObject

fMessageLine

protected SystemMessageLine fMessageLine

pendingMessage

protected SystemMessage pendingMessage

pendingErrorMessage

protected SystemMessage pendingErrorMessage

minWidth

protected int minWidth

minHeight

protected int minHeight

marginWidth

protected int marginWidth

marginHeight

protected int marginHeight

verticalSpacing

protected int verticalSpacing

horizontalSpacing

protected int horizontalSpacing

dialogMnemonics

protected Mnemonics dialogMnemonics

outputObjectValidator

protected ISystemValidator outputObjectValidator

activeRunningOperations

protected long activeRunningOperations

operationCancelableState

protected boolean operationCancelableState

needsProgressMonitor

protected boolean needsProgressMonitor

progressMonitorPart

protected ProgressMonitorPart progressMonitorPart

waitCursor

protected Cursor waitCursor

arrowCursor

protected Cursor arrowCursor

windowClosingDialog

protected MessageDialog windowClosingDialog

cancelListener

protected SelectionAdapter cancelListener

BROWSE_ID

protected static final int BROWSE_ID
See Also:
Constant Field Values

TEST_ID

protected static final int TEST_ID
See Also:
Constant Field Values

ADD_ID

protected static final int ADD_ID
See Also:
Constant Field Values

DETAILS_ID

protected static final int DETAILS_ID
See Also:
Constant Field Values

BROWSE_BUTTON_YES

protected static final boolean BROWSE_BUTTON_YES
See Also:
Constant Field Values

BROWSE_BUTTON_NO

protected static final boolean BROWSE_BUTTON_NO
See Also:
Constant Field Values

TEST_BUTTON_YES

protected static final boolean TEST_BUTTON_YES
See Also:
Constant Field Values

TEST_BUTTON_NO

protected static final boolean TEST_BUTTON_NO
See Also:
Constant Field Values

ADD_BUTTON_YES

protected static final boolean ADD_BUTTON_YES
See Also:
Constant Field Values

ADD_BUTTON_NO

protected static final boolean ADD_BUTTON_NO
See Also:
Constant Field Values

DETAILS_BUTTON_YES

protected static final boolean DETAILS_BUTTON_YES
See Also:
Constant Field Values

DETAILS_BUTTON_NO

protected static final boolean DETAILS_BUTTON_NO
See Also:
Constant Field Values
Constructor Detail

SystemPromptDialog

public SystemPromptDialog(Shell shell,
                          String title)
Constructor one: ok and cancel buttons

Parameters:
shell - - parent window this dialog is modal to.
title - - the title for the dialog. Typically translated.
See Also:
setInputObject(Object)

SystemPromptDialog

public SystemPromptDialog(Shell shell,
                          String title,
                          Image titleImage)
Constructor two: ok and cancel buttons and an icon for the dialog title area

Parameters:
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.
See Also:
setInputObject(Object)

SystemPromptDialog

public SystemPromptDialog(Shell shell,
                          String title,
                          Object inputObject,
                          boolean browse)
Constructor five: ok, browse and cancel buttons, plus explicit setting of input object

Parameters:
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.

SystemPromptDialog

public 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

Parameters:
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.

SystemPromptDialog

public 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

Method Detail

configureShell

protected void configureShell(Shell shell)

setNeedsProgressMonitor

public void setNeedsProgressMonitor(boolean needs)
Specify if a progress monitor is desired in this dialog. Should be called right after instantiation. The default is false. If true is specified, area on the dialog is reserved for the progress monitor, and the monitor can be retrieved via getProgressMonitor().

Support is patterned after WizardDialog in JFace.


setHelp

public void setHelp(String helpId)
For setting the default overall help for the dialog. This can be overridden per control by calling setHelp(Control, String).


getHelpContextId

public String getHelpContextId()
For retrieving the help Id


setHelp

public void setHelp(Control c,
                    String helpId)
For setting control-specific help for a control on the wizard page.

This overrides the default set in the call to setHelp(String).


setInputObject

public void setInputObject(Object inputObject)
For explicitly setting input object. Called by SystemDialogAction

Specified by:
setInputObject in interface ISystemPromptDialog

getInputObject

public Object getInputObject()
For explicitly getting input object

Specified by:
getInputObject in interface ISystemPromptDialog

getOutputObject

public Object getOutputObject()
For explicitly getting output object after dialog is dismissed. Set by the dialog's processOK method.

Specified by:
getOutputObject in interface ISystemPromptDialog

wasCancelled

public boolean wasCancelled()
Allow caller to determine if window was cancelled or not.

Specified by:
wasCancelled in interface ISystemPromptDialog

setOutputObjectValidator

public void setOutputObjectValidator(ISystemValidator outputObjectValidator)
If validation of the output object is desired, set the validator here. It will be used when the child class calls setOutputObject().


getOutputObjectValidator

public ICellEditorValidator getOutputObjectValidator()
Return the output object validator


getMessageLine

public ISystemMessageLine getMessageLine()
Get the ISystemMessageLine control reference.


setOutputObject

protected SystemMessage setOutputObject(Object outputObject)
For explicitly setting output object. Call this in your processOK method. If an output object validator has been set via setOutputObjectValidator, then this will call its isValid method on the outputObject and will return the error message if any that it issues. A return of null always means no errors and hence it is ok to dismiss the dialog.


setBusyCursor

public void setBusyCursor(boolean setBusy)
Set the cursor to the wait cursor (true) or restores it to the normal cursor (false).


setShowOkButton

public void setShowOkButton(boolean showOk)
Disable showing of Ok button


setOkButtonLabel

public void setOkButtonLabel(String label)
For explicitly setting ok button label


setOkButtonToolTipText

public void setOkButtonToolTipText(String tip)
For explicitly setting ok button tooltip text


enableOkButton

public void enableOkButton(boolean enable)
For explicitly enabling/disabling ok button.


getOkButton

public Button getOkButton()
Return ok button widget


setInitialOKButtonEnabledState

public void setInitialOKButtonEnabledState(boolean enabled)
Set initial enabled state of ok button. Call this from createContents, which is called before the ok button is created.


processOK

protected boolean processOK()
To be overridden by children. Called when user presses OK button. Child dialog class should set output object. Return true to close dialog. Return false to not close dialog.


setCancelButtonLabel

public void setCancelButtonLabel(String label)
For explicitly setting cancel button label


setCancelButtonToolTipText

public void setCancelButtonToolTipText(String tip)
For explicitly setting cancel button tooltip text


enableCancelButton

public void enableCancelButton(boolean enable)
For explicitly enabling/disabling cancel button.


getCancelOrCloseButton

public Button getCancelOrCloseButton()
Return cancel button widget. Be careful not to call the deprecated inherited method getCancelButton()!


processCancel

protected boolean processCancel()
To be overridden by children. Called when user presses CANCEL button. Return true to close dialog. Return false to not close dialog.


setShowBrowseButton

public void setShowBrowseButton(boolean show)
Explicitly specify if Browse Button to be shown


setBrowseButtonLabel

public void setBrowseButtonLabel(String label)
For explicitly setting browse button label


setBrowseButtonToolTipText

public void setBrowseButtonToolTipText(String tip)
For explicitly setting Browse button tooltip text


enableBrowseButton

public void enableBrowseButton(boolean enable)
For explicitly enabling/disabling Browse button.


getBrowseButton

public Button getBrowseButton()
Return browse button widget


processBrowse

protected boolean processBrowse()
To be overridden by children. Called when user presses BROWSE button. Return false always!


setShowTestButton

public void setShowTestButton(boolean show)
Explicitly specify if Test Button to be shown


setTestButtonLabel

public void setTestButtonLabel(String label)
For explicitly setting test button label


setTestButtonToolTipText

public void setTestButtonToolTipText(String tip)
For explicitly setting Test button tooltip text


enableTestButton

public void enableTestButton(boolean enable)
For explicitly enabling/disabling Test button.


getTestButton

public Button getTestButton()
Return test button widget


processTest

protected boolean processTest()
To be overridden by children. Called when user presses TEST button. Return false always!


setShowAddButton

public void setShowAddButton(boolean show)
Explicitly specify if Add Button to be shown


setAddButtonLabel

public void setAddButtonLabel(String label)
For explicitly setting Add button label


setAddButtonToolTipText

public void setAddButtonToolTipText(String tip)
For explicitly setting Add button tooltip text


enableAddButton

public void enableAddButton(boolean enable)
For explicitly enabling/disabling Add button.


getAddButton

public Button getAddButton()
Return Add button widget


processAdd

protected boolean processAdd()
To be overridden by children. Called when user presses ADD button. Return false always!


setShowDetailsButton

public void setShowDetailsButton(boolean show,
                                 boolean hideMode)
Explicitly specify if Details Button to be shown. There is support to automatically toggle the text.


setDetailsButtonLabel

public void setDetailsButtonLabel(String showLabel,
                                  String hideLabel)
For explicitly setting Details button label


setDetailsButtonToolTipText

public void setDetailsButtonToolTipText(String showTip,
                                        String hideTip)
For explicitly setting Details button tooltip text


enableDetailsButton

public void enableDetailsButton(boolean enable)
For explicitly enabling/disabling Details button.


getDetailsButton

public Button getDetailsButton()
Return Details button widget


processDetails

protected boolean processDetails(boolean hideMode)
To be overridden by children. Called when user presses DETAILS button.

Note the text is automatically toggled for you! You need only do whatever the functionality is that you desire

Parameters:
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.
Returns:
true if the details state toggle was successful, false if it failed.

getDialogMnemonics

public Mnemonics getDialogMnemonics()
Get the list of all unique mnemonics used by buttons on this dialog. This is only set at the time createButtonBar is called by the parent, and this is after the createContents method call. It will return null until then. So, it is not available for you at constructor time. Use setUniqueMnemonic(Button) on the returned object if you want to add a mnemonic to button after the fact.


createMessageLine

protected ISystemMessageLine createMessageLine(Composite c)
Create message line.


run

public void run()
For asynch exec we defer some operations until other pending events are processed. For now, this is used to display pending error messages

Specified by:
run in interface Runnable

handleEvent

public void handleEvent(Event e)
Handles events generated by controls on this page. Should be overridden by child. Only public because of interface requirement!


pack

protected void pack()
Deprecated.  

Swing-like method to auto-set the size of this dialog by looking at the preferred sizes of all constituents.


createInner

protected abstract Control createInner(Composite parent)
Called by createContents method. Create this dialog's widgets inside a composite. Child classes must override this.


getInitialFocusControl

protected abstract Control getInitialFocusControl()
Return the Control to be given initial focus. Child classes must override this, but can return null.


buttonPressed

protected void buttonPressed(int buttonId)
Override of parent method. Called by IDE when button is pressed.


createButtonBar

protected Control createButtonBar(Composite parent)
Intercept of parent, so we can create the msg line above the button bar.


adjustButtonWidth

protected void adjustButtonWidth(Button button)
Adjust the width hint of a button to account for the presumed addition of a mnemonic.

Parameters:
button - the button whose width is to be adjusted.

createButtonsForButtonBar

protected void createButtonsForButtonBar(Composite parent)
Add buttons to the dialog's button bar. Subclasses may override.

Parameters:
parent - the button bar composite

setMinimumSize

public void setMinimumSize(int width,
                           int height)
Set minimum width and height for this dialog. Pass zero for either to not affect it.


createContents

protected Control createContents(Composite parent)
Override of parent.


applyMnemonics

protected void applyMnemonics(Mnemonics mnemonics,
                              Composite c)
Apply mnemonic to the composite.

Parameters:
c - the composite.

createDialogArea

protected Control createDialogArea(Composite parent)
Called by parent. Create overall dialog page layout.


setPageComplete

public void setPageComplete(boolean complete)
Call this to disable the Apply button if the input is not complete or not valid.


addSeparatorLine

protected Label addSeparatorLine(Composite parent,
                                 int nbrColumns)
Add a separator line. This is a physically visible line.


addFillerLine

protected Label addFillerLine(Composite parent,
                              int nbrColumns)
Add a spacer line


addGrowableFillerLine

protected Label addGrowableFillerLine(Composite parent,
                                      int nbrColumns)
Add a spacer line that grows in height to absorb extra space


publicConvertWidthInCharsToPixels

public int publicConvertWidthInCharsToPixels(int chars)
Expose inherited protected method convertWidthInCharsToPixels as a publicly excessible method

Specified by:
publicConvertWidthInCharsToPixels in interface ISystemPromptDialog

publicConvertHeightInCharsToPixels

public int publicConvertHeightInCharsToPixels(int chars)
Expose inherited protected method convertHeightInCharsToPixels as a publicly excessible method

Specified by:
publicConvertHeightInCharsToPixels in interface ISystemPromptDialog

clearErrorMessage

public void clearErrorMessage()
Clears the currently displayed error message and redisplayes the message which was active before the error message was set.

Specified by:
clearErrorMessage in interface ISystemMessageLine

clearMessage

public void clearMessage()
Clears the currently displayed message.

Specified by:
clearMessage in interface ISystemMessageLine

getErrorMessage

public String getErrorMessage()
Get the currently displayed error text.

Specified by:
getErrorMessage in interface ISystemMessageLine
Returns:
The error message. If no error message is displayed null is returned.

getSystemErrorMessage

public SystemMessage getSystemErrorMessage()
Get the currently displayed error text.

Specified by:
getSystemErrorMessage in interface ISystemMessageLine
Returns:
The error message. If no error message is displayed null is returned.

getMessage

public String getMessage()
Get the currently displayed message.

Specified by:
getMessage in interface ISystemMessageLine
Returns:
The message. If no message is displayed null is returned.

setErrorMessage

public void setErrorMessage(String message)
Display the given error message. A currently displayed message is saved and will be redisplayed when the error message is cleared.

Specified by:
setErrorMessage in interface ISystemMessageLine

setErrorMessage

public void setErrorMessage(SystemMessage message)
Display the given error message. A currently displayed message is saved and will be redisplayed when the error message is cleared.

Specified by:
setErrorMessage in interface ISystemMessageLine

setMessage

public void setMessage(String message)
Set the message text. If the message line currently displays an error, the message is stored and will be shown after a call to clearErrorMessage

Specified by:
setMessage in interface ISystemMessageLine

setMessage

public 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

Specified by:
setMessage in interface ISystemMessageLine

setErrorMessage

public void setErrorMessage(Throwable exc)
Convenience method to set an error message from an exception

Specified by:
setErrorMessage in interface ISystemMessageLine

setDescription

public void setDescription(String description)

getDescription

public String getDescription()

getImage

public Image getImage()

performHelp

public void performHelp()

setVisible

public void setVisible(boolean visible)

dispose

public void dispose()

getControl

public Control getControl()

setControl

public void setControl(Control c)

createControl

public void createControl(Composite parent)

setImageDescriptor

public void setImageDescriptor(ImageDescriptor id)

getTitle

public String getTitle()
Get the dialog's title


setTitle

public void setTitle(String title)
Set the dialog's title


getProgressMonitor

protected IProgressMonitor getProgressMonitor()
Returns the progress monitor for this dialog (if it has one).

Returns:
the progress monitor, or null if this dialog does not have one

aboutToStart

protected Object aboutToStart(boolean enableCancelButton)
About to start a long running operation tiggered through the dialog. Shows the progress monitor and disables the dialog's buttons and controls.

Parameters:
enableCancelButton - true if the Cancel button should be enabled, and false if it should be disabled
Returns:
the saved UI state

createWizardClosingDialog

protected MessageDialog createWizardClosingDialog()
Creates and returns a new wizard closing dialog without openiong it.


close

public boolean close()

okToClose

protected boolean okToClose()
Checks whether it is alright to close this wizard dialog and perform standard cancel processing. If there is a long running operation in progress, this method posts an alert message saying that the wizard cannot be closed.

Returns:
true if it is alright to close this dialog, and false if it is not

hardClose

protected boolean hardClose()
Closes this window. Really closes it. Calls super.close()

Returns:
true if the window is (or was already) closed, and false if it is still open

restoreEnableState

protected void restoreEnableState(Control w,
                                  Map h,
                                  String key)
Restores the enabled/disabled state of the given control.

Parameters:
w - the control
h - the map (key type: String, element type: Boolean)
key - the key
See Also:
saveEnableStateAndSet(Control, java.util.Map, java.lang.String, boolean)

restoreUIState

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.

Parameters:
state - a map containing the saved state as returned by saveUIState
See Also:
saveUIState(boolean)

saveUIState

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. All these controls are disabled in the process, with the possible excepton of the Cancel button.

Parameters:
keepCancelEnabled - true if the Cancel button should remain enabled, and false if it should be disabled
Returns:
a map containing the saved state suitable for restoring later with restoreUIState
See Also:
restoreUIState(java.util.Map)

saveEnableStateAndSet

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.

Parameters:
w - the control, or null if none
h - the map (key type: String, element type: Boolean)
key - the key
enabled - true to enable the control, and false to disable it
See Also:
restoreEnableState(Control,Map,String)

setDisplayCursor

protected void setDisplayCursor(Cursor c)
Sets the given cursor for all shells currently active for this window's display.

Parameters:
c - the cursor

setDisplayCursor

public static void setDisplayCursor(Shell shell,
                                    Cursor c)
Sets the given cursor for all shells currently active for the given shell's display.

Parameters:
c - the cursor

run

public void run(boolean fork,
                boolean cancelable,
                IRunnableWithProgress runnable)
         throws InvocationTargetException,
                InterruptedException
For IRunnableContext.

Throws:
InvocationTargetException
InterruptedException

Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.