Java Code Examples for org.eclipse.jface.dialogs.DialogPage#setMessage()
The following examples show how to use
org.eclipse.jface.dialogs.DialogPage#setMessage() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DartLog.java From dartboard with Eclipse Public License 2.0 | 6 votes |
public static void applyToStatusLine(DialogPage page, IStatus status) { String message = status.getMessage(); switch (status.getSeverity()) { case IStatus.OK: page.setMessage(message, IMessageProvider.NONE); page.setErrorMessage(null); break; case IStatus.WARNING: page.setMessage(message, IMessageProvider.WARNING); page.setErrorMessage(null); break; case IStatus.INFO: page.setMessage(message, IMessageProvider.INFORMATION); page.setErrorMessage(null); break; default: if (message.isEmpty()) { message = null; } page.setMessage(null); page.setErrorMessage(message); break; } }
Example 2
Source File: AbstractN4JSPreferencePage.java From n4js with Eclipse Public License 1.0 | 6 votes |
/** copied from PropertyAndPreferencePage */ private static void applyToStatusLine(DialogPage page, IStatus status) { String message = status.getMessage(); if (message != null && message.length() == 0) { message = null; } switch (status.getSeverity()) { case IStatus.OK: page.setMessage(message, IMessageProvider.NONE); page.setErrorMessage(null); break; case IStatus.WARNING: page.setMessage(message, IMessageProvider.WARNING); page.setErrorMessage(null); break; case IStatus.INFO: page.setMessage(message, IMessageProvider.INFORMATION); page.setErrorMessage(null); break; default: page.setMessage(null); page.setErrorMessage(message); break; } }
Example 3
Source File: AbstractWizardPage.java From tm4e with Eclipse Public License 1.0 | 6 votes |
/** * Applies the status to the status line of a dialog page. */ private static void applyToStatusLine(DialogPage page, IStatus status) { String message = Status.OK_STATUS.equals(status) ? null : status.getMessage(); switch (status.getSeverity()) { case IStatus.OK: page.setMessage(message, IMessageProvider.NONE); page.setErrorMessage(null); break; case IStatus.WARNING: page.setMessage(message, IMessageProvider.WARNING); page.setErrorMessage(null); break; case IStatus.INFO: page.setMessage(message, IMessageProvider.INFORMATION); page.setErrorMessage(null); break; default: if (message != null && message.length() == 0) { message = null; } page.setMessage(null); page.setErrorMessage(message); break; } }
Example 4
Source File: SelectLanguageConfigurationWizardPage.java From tm4e with Eclipse Public License 1.0 | 6 votes |
private static void applyToStatusLine(DialogPage page, IStatus status) { String message = Status.OK_STATUS.equals(status) ? null : status.getMessage(); switch (status.getSeverity()) { case IStatus.OK: page.setMessage(message, IMessageProvider.NONE); page.setErrorMessage(null); break; case IStatus.WARNING: page.setMessage(message, IMessageProvider.WARNING); page.setErrorMessage(null); break; case IStatus.INFO: page.setMessage(message, IMessageProvider.INFORMATION); page.setErrorMessage(null); break; default: if (message != null && message.length() == 0) { message = null; } page.setMessage(null); page.setErrorMessage(message); break; } }
Example 5
Source File: MavenCoordinatesWizardUi.java From google-cloud-eclipse with Apache License 2.0 | 6 votes |
/** * Convenience method to set a validation message on {@link DialogPage} from the result of calling * {@link #validateMavenSettings()}. * * @return {@code true} if no validation message was set; {@code false} otherwise * * @see #validateMavenSettings() */ public boolean setValidationMessage(DialogPage page) { IStatus status = validateMavenSettings(); if (status.isOK()) { return true; } if (IStatus.ERROR == status.getSeverity()) { page.setErrorMessage(status.getMessage()); } else if (IStatus.WARNING == status.getSeverity()) { page.setMessage(status.getMessage(), IMessageProvider.WARNING); } else if (IStatus.INFO == status.getSeverity()) { page.setMessage(status.getMessage(), IMessageProvider.INFORMATION); } return false; }
Example 6
Source File: PropertyAndPreferencePage.java From xtext-eclipse with Eclipse Public License 2.0 | 6 votes |
private static void applyToStatusLine(DialogPage page, IStatus status) { String message = status.getMessage(); if (message != null && message.length() == 0) { message = null; } switch (status.getSeverity()) { case IStatus.OK: page.setMessage(message, IMessageProvider.NONE); page.setErrorMessage(null); break; case IStatus.WARNING: page.setMessage(message, IMessageProvider.WARNING); page.setErrorMessage(null); break; case IStatus.INFO: page.setMessage(message, IMessageProvider.INFORMATION); page.setErrorMessage(null); break; default: page.setMessage(null); page.setErrorMessage(message); break; } }
Example 7
Source File: TexlipseWizardPage.java From texlipse with Eclipse Public License 1.0 | 6 votes |
/** * Add a status bar message. * * @param page * @param status */ protected static void applyToStatusLine(DialogPage page, IStatus status) { String errorMessage = null; String warningMessage = null; String statusMessage = status.getMessage(); if (statusMessage.length() > 0) { if (status.matches(IStatus.ERROR)) { errorMessage = statusMessage; } else if (!status.isOK()) { warningMessage = statusMessage; } } page.setErrorMessage(errorMessage); page.setMessage(warningMessage, status.getSeverity()); }
Example 8
Source File: StatusUtil.java From typescript.java with MIT License | 6 votes |
/** * Applies the status to the status line of a dialog page. */ public static void applyToStatusLine(DialogPage page, IStatus status) { String message= Status.OK_STATUS.equals(status) ? null : status.getMessage(); switch (status.getSeverity()) { case IStatus.OK: page.setMessage(message, IMessageProvider.NONE); page.setErrorMessage(null); break; case IStatus.WARNING: page.setMessage(message, IMessageProvider.WARNING); page.setErrorMessage(null); break; case IStatus.INFO: page.setMessage(message, IMessageProvider.INFORMATION); page.setErrorMessage(null); break; default: if (message.length() == 0) { message= null; } page.setMessage(null); page.setErrorMessage(message); break; } }
Example 9
Source File: StatusUtil.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 6 votes |
/** * Applies the status to the status line of a dialog page. * @param page the dialog page * @param status the status to apply */ public static void applyToStatusLine(DialogPage page, IStatus status) { String message= status.getMessage(); if (message != null && message.length() == 0) { message= null; } switch (status.getSeverity()) { case IStatus.OK: page.setMessage(message, IMessageProvider.NONE); page.setErrorMessage(null); break; case IStatus.WARNING: page.setMessage(message, IMessageProvider.WARNING); page.setErrorMessage(null); break; case IStatus.INFO: page.setMessage(message, IMessageProvider.INFORMATION); page.setErrorMessage(null); break; default: page.setMessage(null); page.setErrorMessage(message); break; } }
Example 10
Source File: StatusUtil.java From editorconfig-eclipse with Apache License 2.0 | 6 votes |
/** * Applies the status to the status line of a dialog page. */ public static void applyToStatusLine(DialogPage page, IStatus status) { String message= status.getMessage(); switch (status.getSeverity()) { case IStatus.OK: page.setMessage(message, IMessageProvider.NONE); page.setErrorMessage(null); break; case IStatus.WARNING: page.setMessage(message, IMessageProvider.WARNING); page.setErrorMessage(null); break; case IStatus.INFO: page.setMessage(message, IMessageProvider.INFORMATION); page.setErrorMessage(null); break; default: if (message.length() == 0) { message= null; } page.setMessage(null); page.setErrorMessage(message); break; } }
Example 11
Source File: AbstractPydevPrefs.java From Pydev with Eclipse Public License 1.0 | 6 votes |
/** * Applies the status to the status line of a dialog page. * * @param page the dialog page * @param status the status */ public void applyToStatusLine(DialogPage page, IStatus status) { String message = status.getMessage(); switch (status.getSeverity()) { case IStatus.OK: page.setMessage(message, IMessageProvider.NONE); page.setErrorMessage(null); break; case IStatus.WARNING: page.setMessage(message, IMessageProvider.WARNING); page.setErrorMessage(null); break; case IStatus.INFO: page.setMessage(message, IMessageProvider.INFORMATION); page.setErrorMessage(null); break; default: if (message.length() == 0) { message = null; } page.setMessage(null); page.setErrorMessage(message); break; } }
Example 12
Source File: StatusUtil.java From Pydev with Eclipse Public License 1.0 | 6 votes |
/** * Applies the status to the status line of a dialog page. * @param page the dialog page * @param status the status to apply */ public static void applyToStatusLine(DialogPage page, IStatus status) { String message = status.getMessage(); if (message != null && message.length() == 0) { message = null; } switch (status.getSeverity()) { case IStatus.OK: page.setMessage(message, IMessageProvider.NONE); page.setErrorMessage(null); break; case IStatus.WARNING: page.setMessage(message, IMessageProvider.WARNING); page.setErrorMessage(null); break; case IStatus.INFO: page.setMessage(message, IMessageProvider.INFORMATION); page.setErrorMessage(null); break; default: page.setMessage(null); page.setErrorMessage(message); break; } }
Example 13
Source File: StatusUtil.java From APICloud-Studio with GNU General Public License v3.0 | 5 votes |
/** * Applies the status to the status line of a dialog page. */ public static void applyToStatusLine(DialogPage page, IStatus status) { String message = status.getMessage(); switch (status.getSeverity()) { case IStatus.OK: page.setMessage(message, IMessageProvider.NONE); page.setErrorMessage(null); break; case IStatus.WARNING: page.setMessage(message, IMessageProvider.WARNING); page.setErrorMessage(null); break; case IStatus.INFO: page.setMessage(message, IMessageProvider.INFORMATION); page.setErrorMessage(null); break; default: if (message.length() == 0) { message = null; } page.setMessage(null); page.setErrorMessage(message); break; } }
Example 14
Source File: StatusUtil.java From birt with Eclipse Public License 1.0 | 5 votes |
/** * Applies the status to the status line of a dialog page. * * @param page * the dialog page * @param status * the status to apply */ public static void applyToStatusLine( DialogPage page, IStatus status ) { if ( status == null ) { page.setMessage( null, IMessageProvider.NONE ); page.setErrorMessage( null ); return; } String message = status.getMessage( ); if ( message != null && message.length( ) == 0 ) { message = null; } switch ( status.getSeverity( ) ) { case IStatus.OK : page.setMessage( message, IMessageProvider.NONE ); page.setErrorMessage( null ); break; case IStatus.WARNING : page.setMessage( message, IMessageProvider.WARNING ); page.setErrorMessage( null ); break; case IStatus.INFO : page.setMessage( message, IMessageProvider.INFORMATION ); page.setErrorMessage( null ); break; default : page.setMessage( null ); page.setErrorMessage( message ); break; } }
Example 15
Source File: DialogPageUtils.java From goclipse with Eclipse Public License 1.0 | 5 votes |
public static void applyStatusToPage(DialogPage page, IStatus status) { String message = StringUtil.emptyAsNull(status.getMessage()); if(status.getSeverity() == IStatus.ERROR) { page.setErrorMessage(message); page.setMessage(null); } else { page.setErrorMessage(null); page.setMessage(message, severityToMessageType(status)); } }