1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-15 13:05:22 +02:00

[cleanup] Add SystemMessageDialog Javadoc

This commit is contained in:
Martin Oberhuber 2008-04-10 11:16:40 +00:00
parent b20818249f
commit b52b3deeaa

View file

@ -18,6 +18,7 @@
* David McKnight (IBM) - [216596] determine whether to show yes/no or just okay * David McKnight (IBM) - [216596] determine whether to show yes/no or just okay
* David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible
* David McKnight (IBM) - [220547] [api][breaking] SimpleSystemMessage needs to specify a message id and some messages should be shared * David McKnight (IBM) - [220547] [api][breaking] SimpleSystemMessage needs to specify a message id and some messages should be shared
* Martin Oberhuber (Wind River) - Adding Javadoc
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.ui.messages; package org.eclipse.rse.ui.messages;
@ -57,6 +58,30 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text; import org.eclipse.swt.widgets.Text;
/** /**
* 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):
* <ul>
* <li>{@link #openError(Shell, String, String, IStatus)}</li>
* <li>{@link #openError(Shell, String, String, IStatus, int)}</li>
* </ul>
* or one of the convenience static factory methods which also switch to the UI
* thread automatically to synchronously open the dialog there if needed:
* <ul>
* <li>{@link #show(Shell, SystemMessage)}</li>
* <li>{@link #showExceptionMessage(Shell, String, Exception)}</li>
* <li>{@link #displayErrorMessage(Shell, String)}</li>
* <li>{@link #displayErrorMessage(Shell, SystemMessage)}</li>
* <li>{@link #displayErrorMessage(Shell, SystemMessage, Throwable)}</li>
* <li>... and many more displayXXX() static methods.</li>
* </ul>
*
* @noextend This class is not intended to be subclassed by clients, because we
* want a uniform appearance of message dialogs.
*/ */
public class SystemMessageDialog extends ErrorDialog implements Listener { public class SystemMessageDialog extends ErrorDialog implements Listener {
@ -379,7 +404,7 @@ public class SystemMessageDialog extends ErrorDialog implements Listener {
/** /**
* logs the message in the appropriate log * logs the message in the appropriate log
*/ */
private void LogMessage() private void logMessage()
{ {
Object[] subList=message.getSubVariables(); Object[] subList=message.getSubVariables();
for (int i=0; subList!=null && i<subList.length; i++) for (int i=0; subList!=null && i<subList.length; i++)
@ -427,7 +452,7 @@ public class SystemMessageDialog extends ErrorDialog implements Listener {
public int open() public int open()
{ {
if (!showDetails) if (!showDetails)
LogMessage(); logMessage();
return super.open(); return super.open();
} }
@ -454,9 +479,12 @@ public class SystemMessageDialog extends ErrorDialog implements Listener {
} }
/** /**
* opens the dialog with Yes, No, Details button for an Inquiry/Question message * Open the dialog with Yes, No, Details button for an Inquiry/Question
* Throws an IndicatorException if the message is not an Inquiry message * message.
* returns true if Yes was pressed, False if No was pressed. *
* @throws IndicatorException if the message is not an Inquiry message
* @return <code>true</code> if Yes was pressed, <code>false</code> if
* No was pressed.
*/ */
public boolean openQuestion() throws IndicatorException public boolean openQuestion() throws IndicatorException
{ {
@ -468,8 +496,12 @@ public class SystemMessageDialog extends ErrorDialog implements Listener {
} }
/** /**
* opens the dialog with Yes/No, Details button for an Inquiry/Question message. * Open the dialog with Yes/No, Details button for an Inquiry/Question
* Eats up the IndicatorException, so only call this when you know what you are doing! * message. Eats up the IndicatorException, so only call this when you know
* what you are doing!
*
* @return <code>true</code> if Yes was pressed, <code>false</code> if
* No was pressed.
*/ */
public boolean openQuestionNoException() public boolean openQuestionNoException()
{ {
@ -780,7 +812,8 @@ public class SystemMessageDialog extends ErrorDialog implements Listener {
} }
/** /**
* Put up an error message when the error msg framework itself doesn't work. * Put up an error message when the error message framework itself doesn't
* work, and also log the error.
*/ */
public static void showExceptionMessage(Shell shell, String msg, Exception exc) public static void showExceptionMessage(Shell shell, String msg, Exception exc)
{ {