mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-15 04:55:22 +02:00
[cleanup] Add SystemMessageDialog Javadoc
This commit is contained in:
parent
b20818249f
commit
b52b3deeaa
1 changed files with 140 additions and 107 deletions
|
@ -18,6 +18,7 @@
|
|||
* 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) - [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;
|
||||
|
@ -57,6 +58,30 @@ import org.eclipse.swt.widgets.Shell;
|
|||
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 {
|
||||
|
||||
|
@ -379,7 +404,7 @@ public class SystemMessageDialog extends ErrorDialog implements Listener {
|
|||
/**
|
||||
* logs the message in the appropriate log
|
||||
*/
|
||||
private void LogMessage()
|
||||
private void logMessage()
|
||||
{
|
||||
Object[] subList=message.getSubVariables();
|
||||
for (int i=0; subList!=null && i<subList.length; i++)
|
||||
|
@ -427,7 +452,7 @@ public class SystemMessageDialog extends ErrorDialog implements Listener {
|
|||
public int open()
|
||||
{
|
||||
if (!showDetails)
|
||||
LogMessage();
|
||||
logMessage();
|
||||
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
|
||||
* Throws an IndicatorException if the message is not an Inquiry message
|
||||
* returns true if Yes was pressed, False if No was pressed.
|
||||
* Open the dialog with Yes, No, Details button for an Inquiry/Question
|
||||
* message.
|
||||
*
|
||||
* @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
|
||||
{
|
||||
|
@ -468,8 +496,12 @@ public class SystemMessageDialog extends ErrorDialog implements Listener {
|
|||
}
|
||||
|
||||
/**
|
||||
* 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!
|
||||
* Open 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!
|
||||
*
|
||||
* @return <code>true</code> if Yes was pressed, <code>false</code> if
|
||||
* No was pressed.
|
||||
*/
|
||||
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)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue