|
RSE Release 3.4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jface.window.Window
org.eclipse.jface.dialogs.Dialog
org.eclipse.jface.dialogs.IconAndMessageDialog
org.eclipse.jface.dialogs.ErrorDialog
org.eclipse.rse.ui.messages.SystemMessageDialog
public class SystemMessageDialog
A dialog for showing SystemMessages and optionally asking the user for Yes / No / Ok / Cancel type of response. The client may choose to construct and open the dialog itself, or use one of the provided static factory methods, which construct the dialog and synchronously open it without thread switch (must be called on the UI thread):
ErrorDialog.openError(Shell, String, String, IStatus)
ErrorDialog.openError(Shell, String, String, IStatus, int)
show(Shell, SystemMessage)
showExceptionMessage(Shell, String, Exception)
displayErrorMessage(Shell, String)
displayErrorMessage(Shell, SystemMessage)
displayErrorMessage(Shell, SystemMessage, Throwable)
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.eclipse.jface.window.Window |
---|
Window.IExceptionHandler |
Field Summary | |
---|---|
static int |
BUTTON_ID
button id number for the first button in the button bar. |
protected Button |
noShowAgainButton
|
protected boolean |
noShowAgainOption
|
protected String |
prefId
|
protected IPreferenceStore |
prefStore
|
protected boolean |
prefValAsSelected
|
Fields inherited from class org.eclipse.jface.dialogs.ErrorDialog |
---|
AUTOMATED_MODE |
Fields inherited from class org.eclipse.jface.dialogs.IconAndMessageDialog |
---|
imageLabel, messageLabel |
Fields inherited from class org.eclipse.jface.dialogs.Dialog |
---|
blockedHandler, buttonBar, DIALOG_DEFAULT_BOUNDS, DIALOG_PERSISTLOCATION, DIALOG_PERSISTSIZE, dialogArea, DLG_IMG_ERROR, DLG_IMG_HELP, DLG_IMG_INFO, DLG_IMG_MESSAGE_ERROR, DLG_IMG_MESSAGE_INFO, DLG_IMG_MESSAGE_WARNING, DLG_IMG_QUESTION, DLG_IMG_WARNING, ELLIPSIS |
Fields inherited from class org.eclipse.jface.window.Window |
---|
CANCEL, OK |
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. |
protected Button |
createNoShowAgainButton(Composite c)
Creates a button to allow option to not show this dialog again. |
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,
Throwable exc)
For ease of use for simple messages which are the result of an exception |
static void |
displayExceptionMessage(Shell shell,
Throwable 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(Shell shell,
String msgText)
For ease of use for simple message text with no response from user. |
static void |
displayMessage(Shell shell,
SystemMessageException msgEx)
Display this wrapped system message to the user |
static void |
displayMessage(SystemMessageException msgEx)
Display this wrapped system message to the user |
int |
getButtonPressedId()
returns the id of the button pressed |
static Shell |
getDefaultShell()
Keeping for posterity. |
static SystemMessage |
getExceptionMessage(Shell shell,
Throwable exc)
When an exception occurs and you want to turn it into a SystemMessage, call this... |
void |
handleEvent(Event e)
Handles events generated by controls on this page. |
int |
open()
Opens the message dialog to display the message. |
boolean |
openQuestion()
Open the dialog with Yes, No, Details button for an Inquiry/Question message. |
boolean |
openQuestionNoException()
Open the dialog with Yes/No, Details button for an Inquiry/Question message. |
boolean |
openQuestionNoException(boolean showYesNo)
opens the dialog with an optional Yes/No or OK, 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 |
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. |
void |
setNoShowAgainOption(boolean noShowAgainOption,
IPreferenceStore prefStore,
String prefId,
boolean prefValAsSelected)
Set option to not show this dialog again and specify the preference that should be set according to whether the user selects to show the dialog again or no. |
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 message framework itself doesn't work, and also log the error. |
Methods inherited from class org.eclipse.jface.dialogs.ErrorDialog |
---|
close, configureShell, createDetailsButton, createDialogAndButtonArea, createDropDownList, getImage, isResizable, openError, openError, setStatus, shouldDisplay, shouldShowDetailsButton, showDetailsArea |
Methods inherited from class org.eclipse.jface.dialogs.IconAndMessageDialog |
---|
createButtonBar, createContents, createMessageArea, getErrorImage, getInfoImage, getMessageLabelStyle, getQuestionImage, getWarningImage |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int BUTTON_ID
The second button, would have an id of buttonId+1 etc.
protected boolean noShowAgainOption
protected Button noShowAgainButton
protected IPreferenceStore prefStore
protected String prefId
protected boolean prefValAsSelected
Constructor Detail |
---|
public SystemMessageDialog(Shell parentShell, SystemMessage message)
parentShell
- the shell under which to create this dialogmessage
- the message to display in the dialogMethod Detail |
---|
protected void buttonPressed(int id)
buttonPressed
in class ErrorDialog
protected void createButtonsForButtonBar(Composite parent)
createButtonsForButtonBar
in class ErrorDialog
protected Control createDialogArea(Composite parent)
createDialogArea
in class ErrorDialog
protected Text createDropDownList2(Composite parent)
parent
- the parent composite
public void setException(Throwable exc)
public int open()
open
in class ErrorDialog
public int openWithDetails()
public int openWithDetails(Exception exc)
Also logs the first level text plus exception.
public boolean openQuestion()
true
if Yes was pressed, false
if
No was pressed.public boolean openQuestionNoException()
true
if Yes was pressed, false
if
No was pressed.public boolean openQuestionNoException(boolean showYesNo)
public int openYesNoCancel()
public int getButtonPressedId()
public void setButtons(String[] buttonList)
buttonList
- an array of buttons for the button barpublic void setButtonIndex(int buttonIndex)
buttonIndex
- the 0-based index of the buttonpublic static Shell getDefaultShell()
public static void displayErrorMessage(Shell shell, SystemMessage msg)
public static void displayErrorMessage(Shell shell, SystemMessage msg, Throwable exc)
public static void displayErrorMessage(Shell shell, String msgText)
public static void displayMessage(Shell shell, String msgText)
public static void displayMessage(Shell shell, SystemMessageException msgEx)
public static void displayMessage(SystemMessageException msgEx)
public static void displayHostErrorMessage(Shell shell, String hostMsg)
public static void displayHostErrorMessage(Shell shell, String hostMsg, String levelTwo)
public static void displayHostWarningMessage(Shell shell, String hostMsg)
public static void displayHostWarningMessage(Shell shell, String hostMsg, String levelTwo)
public static void displayExceptionMessage(Shell shell, Throwable exc)
public static SystemMessage getExceptionMessage(Shell shell, Throwable exc)
public static void showExceptionMessage(Shell shell, String msg, Exception exc)
public static boolean show(Shell shell, SystemMessage msg)
public void setNoShowAgainOption(boolean noShowAgainOption, IPreferenceStore prefStore, String prefId, boolean prefValAsSelected)
noShowAgainOption
- true
to show the option in the dialog, false
to not show it.prefStore
- the preference store.prefId
- the preference id for which a boolean value will be stored according to the user's selection.prefValAsSelected
- whether to mirror the user selection in the preference. If this is set to
true
, then the value stored in the preference is true
if the user selects the option,
and false
if the user does not select the option. If this is set to false
, then the
value stored in the preference will be false
if the user selects the option, and true
if the user does not select the optionprotected Button createNoShowAgainButton(Composite c)
public void handleEvent(Event e)
handleEvent
in interface Listener
|
RSE Release 3.4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |