Java Code Examples for org.eclipse.jface.dialogs.IMessageProvider#ERROR
The following examples show how to use
org.eclipse.jface.dialogs.IMessageProvider#ERROR .
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: AbapGitDialogObjLog.java From ADT_Frontend with MIT License | 6 votes |
@Override public void create() { super.create(); setTitle(Messages.AbapGitDialogPageObjLog_title); int dialogMessageIcon = IMessageProvider.INFORMATION; String dialogStatusFlag = this.repodata.getStatus(); if (dialogStatusFlag != null && dialogStatusFlag.equals(WARNING_FLAG)) { dialogMessageIcon = IMessageProvider.WARNING; } if (dialogStatusFlag != null && (dialogStatusFlag.equals(ERROR_FLAG) || dialogStatusFlag.equals("A"))) { //$NON-NLS-1$ dialogMessageIcon = IMessageProvider.ERROR; } if (dialogStatusFlag != null && dialogStatusFlag.equals(SUCCESS_FLAG)) { } setMessage(this.repodata.getStatusText() + "\n " + Messages.AbapGitDialogPageObjLog_description, dialogMessageIcon); //$NON-NLS-1$ }
Example 2
Source File: FieldEditorWrapper.java From google-cloud-eclipse with Apache License 2.0 | 6 votes |
@Override public IStatus getStatus() { // DialogPage has an unfortunately complex set of message possibilities String message = messages.getErrorMessage(); if (message != null) { return new Status(IStatus.ERROR, PLUGIN_ID, message); } int messageType = messages.getMessageType(); switch (messageType) { case IMessageProvider.INFORMATION: return new Status(IStatus.INFO, PLUGIN_ID, messages.getMessage()); case IMessageProvider.WARNING: return new Status(IStatus.WARNING, PLUGIN_ID, messages.getMessage()); case IMessageProvider.ERROR: return new Status(IStatus.ERROR, PLUGIN_ID, messages.getMessage()); default: return Status.OK_STATUS; } }
Example 3
Source File: SymbolProviderConfigDialog.java From tracecompass with Eclipse Public License 2.0 | 6 votes |
private void updateMessage(int pageIndex) { ISymbolProviderPreferencePage currentPage = fPreferencePages[pageIndex]; String message = currentPage.getMessage(); String errorMessage = currentPage.getErrorMessage(); int messageType = IMessageProvider.NONE; if (errorMessage != null) { message = errorMessage; messageType = IMessageProvider.ERROR; } setMessage(message, messageType); if (fPreferencePages.length > 1) { // update the corresponding tab icon if (messageType == IMessageProvider.ERROR) { fPageTabs[pageIndex].setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK)); } else { fPageTabs[pageIndex].setImage(null); } } }
Example 4
Source File: DynamicWorkingSetPage.java From eclipse-extras with Eclipse Public License 1.0 | 6 votes |
@SuppressWarnings("incomplete-switch") private void updateStatusMessage( ValidationStatus validationStatus ) { if( visible ) { int messageType = IMessageProvider.NONE; String message = null; switch( validationStatus.getSeverity() ) { case ERROR: messageType = IMessageProvider.ERROR; message = validationStatus.getMessage(); break; case WARNING: messageType = IMessageProvider.WARNING; message = validationStatus.getMessage(); break; } setMessage( message, messageType ); setPageComplete( validationStatus.getSeverity() != Severity.ERROR ); } }
Example 5
Source File: DataSourceEditor.java From birt with Eclipse Public License 1.0 | 6 votes |
public void updateMessage( ) { PropertyPage propertyPage = getCurrentPropertyPage( ); if ( propertyPage != null ) { String message = propertyPage.getMessage( ); int messageType = propertyPage.getMessageType( ); // if error message exists, it takes precedence over page's non-error message if ( messageType < IMessageProvider.ERROR ) { String errMessage = propertyPage.getErrorMessage(); if ( errMessage != null ) { message = errMessage; messageType = IMessageProvider.ERROR; } } setMessage( message, messageType ); } }
Example 6
Source File: AbstractPropertyDialog.java From birt with Eclipse Public License 1.0 | 6 votes |
public final void setMessage( String message, int messageType ) { if ( messageArea != null ) { if ( messageType != IMessageProvider.NONE ) { titleImage.setVisible( false ); } else { titleImage.setVisible( true ); } if ( message == null && messageType == IMessageProvider.ERROR ) { messageArea.updateText( "", messageType ); } else { messageArea.updateText( message, messageType ); } } }
Example 7
Source File: StyleBuilder.java From birt with Eclipse Public License 1.0 | 6 votes |
public void setTitleMessage( String newMessage, int newType ) { Image newImage = null; if ( newMessage != null ) { switch ( newType ) { case IMessageProvider.NONE : break; case IMessageProvider.INFORMATION : newImage = JFaceResources.getImage( DLG_IMG_MESSAGE_INFO ); break; case IMessageProvider.WARNING : newImage = JFaceResources.getImage( DLG_IMG_MESSAGE_WARNING ); break; case IMessageProvider.ERROR : newImage = JFaceResources.getImage( DLG_IMG_MESSAGE_ERROR ); break; } } showTitleMessage( newMessage, newImage ); }
Example 8
Source File: StatusWidget.java From xtext-eclipse with Eclipse Public License 2.0 | 5 votes |
private Image imageFor(int type) { switch (type) { case IMessageProvider.NONE: return null; case IMessageProvider.INFORMATION: return JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_INFO); case IMessageProvider.WARNING: return JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_WARNING); case IMessageProvider.ERROR: return JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_ERROR); default: return null; } }
Example 9
Source File: AbstractProjectPropertyPage.java From gwt-eclipse-plugin with Eclipse Public License 1.0 | 5 votes |
/** * Converts a standard IStatus's severity into the severity flags used by * dialogs and property pages. */ protected static int convertSeverity(IStatus status) { switch (status.getSeverity()) { case IStatus.ERROR: return IMessageProvider.ERROR; case IStatus.WARNING: return IMessageProvider.WARNING; case IStatus.INFO: return IMessageProvider.INFORMATION; default: return IMessageProvider.NONE; } }
Example 10
Source File: AbstractTitleAreaDialog.java From gwt-eclipse-plugin with Eclipse Public License 1.0 | 5 votes |
private static int convertSeverity(IStatus status) { switch (status.getSeverity()) { case IStatus.ERROR: return IMessageProvider.ERROR; case IStatus.WARNING: return IMessageProvider.WARNING; case IStatus.INFO: return IMessageProvider.INFORMATION; default: return IMessageProvider.NONE; } }
Example 11
Source File: GWTCompileDialog.java From gwt-eclipse-plugin with Eclipse Public License 1.0 | 5 votes |
private static int convertSeverity(IStatus status) { switch (status.getSeverity()) { case IStatus.ERROR: return IMessageProvider.ERROR; case IStatus.WARNING: return IMessageProvider.WARNING; case IStatus.INFO: return IMessageProvider.INFORMATION; default: return IMessageProvider.NONE; } }
Example 12
Source File: BaseTitleAreaDialog.java From birt with Eclipse Public License 1.0 | 5 votes |
public void setMessage( String msg, int newType ) { super.setMessage( msg, newType ); if ( newType == IMessageProvider.ERROR ) { this.errorMsg = msg; } else { this.errorMsg = null; } }
Example 13
Source File: DialogPageUtils.java From goclipse with Eclipse Public License 1.0 | 5 votes |
public static int statusLevelToMessageType(StatusLevel statusLevel) { switch (statusLevel) { case OK: return IMessageProvider.NONE; case INFO: return IMessageProvider.INFORMATION; case WARNING: return IMessageProvider.WARNING; case ERROR: return IMessageProvider.ERROR; } throw assertFail(); }
Example 14
Source File: DialogPageUtils.java From goclipse with Eclipse Public License 1.0 | 5 votes |
public static int severityToMessageType(IStatus status) { switch (status.getSeverity()) { case IStatus.ERROR: return IMessageProvider.ERROR; case IStatus.WARNING: return IMessageProvider.WARNING; case IStatus.INFO: return IMessageProvider.INFORMATION; case IStatus.OK: return IMessageProvider.NONE; default: return IMessageProvider.NONE; } }
Example 15
Source File: TSTitleAreaDialog.java From translationstudio8 with GNU General Public License v2.0 | 4 votes |
/** * Sets the message for this dialog with an indication of what type of * message it is. * <p> * The valid message types are one of <code>NONE</code>, * <code>INFORMATION</code>,<code>WARNING</code>, or * <code>ERROR</code>. * </p> * <p> * Note that for backward compatibility, a message of type * <code>ERROR</code> is different than an error message (set using * <code>setErrorMessage</code>). An error message overrides the current * message until the error message is cleared. This method replaces the * current message and does not affect the error message. * </p> * * @param newMessage * the message, or <code>null</code> to clear the message * @param newType * the message type * @since 2.0 */ public void setMessage(String newMessage, int newType) { Image newImage = null; if (newMessage != null) { switch (newType) { case IMessageProvider.NONE: break; case IMessageProvider.INFORMATION: newImage = JFaceResources.getImage(DLG_IMG_MESSAGE_INFO); break; case IMessageProvider.WARNING: newImage = JFaceResources.getImage(DLG_IMG_MESSAGE_WARNING); break; case IMessageProvider.ERROR: newImage = JFaceResources.getImage(DLG_IMG_MESSAGE_ERROR); break; } } showMessage(newMessage, newImage); }
Example 16
Source File: TSTitleAreaDialog.java From tmxeditor8 with GNU General Public License v2.0 | 4 votes |
/** * Sets the message for this dialog with an indication of what type of * message it is. * <p> * The valid message types are one of <code>NONE</code>, * <code>INFORMATION</code>,<code>WARNING</code>, or * <code>ERROR</code>. * </p> * <p> * Note that for backward compatibility, a message of type * <code>ERROR</code> is different than an error message (set using * <code>setErrorMessage</code>). An error message overrides the current * message until the error message is cleared. This method replaces the * current message and does not affect the error message. * </p> * * @param newMessage * the message, or <code>null</code> to clear the message * @param newType * the message type * @since 2.0 */ public void setMessage(String newMessage, int newType) { Image newImage = null; if (newMessage != null) { switch (newType) { case IMessageProvider.NONE: break; case IMessageProvider.INFORMATION: newImage = JFaceResources.getImage(DLG_IMG_MESSAGE_INFO); break; case IMessageProvider.WARNING: newImage = JFaceResources.getImage(DLG_IMG_MESSAGE_WARNING); break; case IMessageProvider.ERROR: newImage = JFaceResources.getImage(DLG_IMG_MESSAGE_ERROR); break; } } showMessage(newMessage, newImage); }