Remote Systems
v6.4.1

com.ibm.etools.systems.core.ui.messages
Class SystemMessageDialog

java.lang.Object
  extended byErrorDialog
      extended bycom.ibm.etools.systems.core.ui.messages.SystemMessageDialog

public class SystemMessageDialog
extends ErrorDialog

See Also:
Serialized Form

Field Summary
static int BUTTON_ID
          button id number for the first button in the button bar.
static String copyright
           
 
Constructor Summary
SystemMessageDialog(Shell parentShell, SystemMessage message)
          Creates an error dialog.
 
Method Summary
protected  void buttonPressed(int id)
           
protected  void createButtonsForButtonBar(Composite parent)
           
protected  Control createDialogArea(Composite parent)
           
protected  Text createDropDownList2(Composite parent)
          Create this dialog's drop-down list component.
static void displayErrorMessage(Shell shell, String msgText)
          For ease of use for simple error message text with no response from user.
static void displayErrorMessage(Shell shell, SystemMessage msg)
          For ease of use for simple messages with no response from user.
static void displayErrorMessage(Shell shell, SystemMessage msg, Exception exc)
          For ease of use for simple messages which are the result of an exception
static void displayExceptionMessage(Shell shell, Exception exc)
          For displaying a generic error message when an unexpected exception happens.
static void displayHostErrorMessage(Shell shell, String hostMsg)
          For ease of use for simple host error messages that are xlated already.
static void displayHostErrorMessage(Shell shell, String hostMsg, String levelTwo)
          For ease of use for simple host error messages that are xlated already, and which have 2nd level text.
static void displayHostWarningMessage(Shell shell, String hostMsg)
          For ease of use for simple host warning messages that are xlated already.
static void displayHostWarningMessage(Shell shell, String hostMsg, String levelTwo)
          For ease of use for simple host warning messages that are xlated already, and which have 2nd level text.
static void displayMessage(org.eclipse.swt.widgets.Shell shell, SystemMessageException msgEx)
          Display this wrapped system message to the user
static void displayMessage(Shell shell, String msgText)
          For ease of use for simple message text with no response from user.
 int getButtonPressedId()
          returns the id of the button pressed
static Shell getDefaultShell()
          Keeping for posterity.
static SystemMessage getExceptionMessage(Shell shell, Exception exc)
          When an exception occurs and you want to turn it into a SystemMessage, call this...
 int open()
          Opens the message dialog to display the message.
 boolean openQuestion()
          opens the dialog with Yes, No, Details button for an Inquiry/Question message Throws an IndicatorException if the message is not an Inquiry message returns true if Yes was pressed, False if No was pressed.
 boolean openQuestionNoException()
          opens the dialog with Yes, No, Details button for an Inquiry/Question message.
 int openWithDetails()
          Opens the message dialog with the details showing to display the message.
 int openWithDetails(Exception exc)
          Opens the message dialog with the details showing to display an exception, if that is the root cause of the message.
 int openYesNoCancel()
          opens the dialog with Yes, No, Cancel Details for an Inquiry/Question message throws an IndicatorException if the indicator is not Inquiry
 void setButtonIndex(int buttonIndex)
          sets the default button for the message.
 void setButtons(String[] buttonList)
          overrides the default button selection.
 void setException(Throwable exc)
          When the message involves an exception for which we want to log the stack, set that exception here.
static boolean show(Shell shell, SystemMessage msg)
          Show this message in the message dialog.
static void showExceptionMessage(Shell shell, String msg, Exception exc)
          Put up an error message when the error msg framework itself doesn't work.
 
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

BUTTON_ID

public static final int BUTTON_ID
button id number for the first button in the button bar.

The second button, would have an id of buttonId+1 etc.

See Also:
Constant Field Values
Constructor Detail

SystemMessageDialog

public SystemMessageDialog(Shell parentShell,
                           SystemMessage message)
Creates an error dialog. Note that the dialog will have no visual representation (no widgets) until it is told to open.

Parameters:
parentShell - the shell under which to create this dialog
message - the message to display in the dialog
Method Detail

buttonPressed

protected void buttonPressed(int id)

createButtonsForButtonBar

protected void createButtonsForButtonBar(Composite parent)

createDialogArea

protected Control createDialogArea(Composite parent)

createDropDownList2

protected Text createDropDownList2(Composite parent)
Create this dialog's drop-down list component.

Parameters:
parent - the parent composite
Returns:
the drop-down list component

setException

public void setException(Throwable exc)
When the message involves an exception for which we want to log the stack, set that exception here.


open

public int open()
Opens the message dialog to display the message.


openWithDetails

public int openWithDetails()
Opens the message dialog with the details showing to display the message.


openWithDetails

public int openWithDetails(Exception exc)
Opens the message dialog with the details showing to display an exception, if that is the root cause of the message.

Also logs the first level text plus exception.


openQuestion

public boolean openQuestion()
                     throws IndicatorException
opens the dialog with Yes, No, Details button for an Inquiry/Question message Throws an IndicatorException if the message is not an Inquiry message returns true if Yes was pressed, False if No was pressed.

Throws:
IndicatorException

openQuestionNoException

public boolean openQuestionNoException()
opens the dialog with Yes, No, Details button for an Inquiry/Question message. Eats up the IndicatorException, so only call this when you know what you are doing!


openYesNoCancel

public int openYesNoCancel()
opens the dialog with Yes, No, Cancel Details for an Inquiry/Question message throws an IndicatorException if the indicator is not Inquiry


getButtonPressedId

public int getButtonPressedId()
returns the id of the button pressed


setButtons

public void setButtons(String[] buttonList)
overrides the default button selection.

Parameters:
buttonList - an array of buttons for the button bar

setButtonIndex

public void setButtonIndex(int buttonIndex)
sets the default button for the message. Use this method if you wan to override the default button (the first one)

Parameters:
buttonIndex - the 0-based index of the button

getDefaultShell

public static Shell getDefaultShell()
Keeping for posterity. Phil.


displayErrorMessage

public static void displayErrorMessage(Shell shell,
                                       SystemMessage msg)
For ease of use for simple messages with no response from user.


displayErrorMessage

public static void displayErrorMessage(Shell shell,
                                       SystemMessage msg,
                                       Exception exc)
For ease of use for simple messages which are the result of an exception


displayErrorMessage

public static void displayErrorMessage(Shell shell,
                                       String msgText)
For ease of use for simple error message text with no response from user.


displayMessage

public static void displayMessage(Shell shell,
                                  String msgText)
For ease of use for simple message text with no response from user.


displayMessage

public static void displayMessage(org.eclipse.swt.widgets.Shell shell,
                                  SystemMessageException msgEx)
Display this wrapped system message to the user


displayHostErrorMessage

public static void displayHostErrorMessage(Shell shell,
                                           String hostMsg)
For ease of use for simple host error messages that are xlated already.


displayHostErrorMessage

public static void displayHostErrorMessage(Shell shell,
                                           String hostMsg,
                                           String levelTwo)
For ease of use for simple host error messages that are xlated already, and which have 2nd level text.


displayHostWarningMessage

public static void displayHostWarningMessage(Shell shell,
                                             String hostMsg)
For ease of use for simple host warning messages that are xlated already.


displayHostWarningMessage

public static void displayHostWarningMessage(Shell shell,
                                             String hostMsg,
                                             String levelTwo)
For ease of use for simple host warning messages that are xlated already, and which have 2nd level text.


displayExceptionMessage

public static void displayExceptionMessage(Shell shell,
                                           Exception exc)
For displaying a generic error message when an unexpected exception happens.


getExceptionMessage

public static SystemMessage getExceptionMessage(Shell shell,
                                                Exception exc)
When an exception occurs and you want to turn it into a SystemMessage, call this...


showExceptionMessage

public static void showExceptionMessage(Shell shell,
                                        String msg,
                                        Exception exc)
Put up an error message when the error msg framework itself doesn't work.


show

public static boolean show(Shell shell,
                           SystemMessage msg)
Show this message in the message dialog. We polymorphically show the right message dialog, by querying the message type.

Returns:
true if this is a question message, and user presses Yes.

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.