Java Code Examples for org.eclipse.jface.dialogs.IMessageProvider#WARNING

The following examples show how to use org.eclipse.jface.dialogs.IMessageProvider#WARNING . 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 vote down vote up
@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 vote down vote up
@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: DynamicWorkingSetPage.java    From eclipse-extras with Eclipse Public License 1.0 6 votes vote down vote up
@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 4
Source File: StyleBuilder.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
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 5
Source File: StatusWidget.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
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 6
Source File: AbstractProjectPropertyPage.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * 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 7
Source File: AbstractTitleAreaDialog.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 5 votes vote down vote up
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 8
Source File: GWTCompileDialog.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 5 votes vote down vote up
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 9
Source File: DialogPageUtils.java    From goclipse with Eclipse Public License 1.0 5 votes vote down vote up
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 10
Source File: DialogPageUtils.java    From goclipse with Eclipse Public License 1.0 5 votes vote down vote up
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 11
Source File: TSTitleAreaDialog.java    From translationstudio8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * 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 12
Source File: TSTitleAreaDialog.java    From tmxeditor8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * 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 13
Source File: FatJarPackageWizardPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * set message to newMessage with severity WARNING.
 * overwrite existing message only if it is beyond severity WARNING
 * @param newMessage the warning to be set
 */
private void setWarningMessage(String newMessage) {
	if (getMessage() == null || getMessageType() < IMessageProvider.WARNING)
		setMessage(newMessage, IMessageProvider.WARNING);
}
 
Example 14
Source File: FixedFatJarExportPage.java    From sarl with Apache License 2.0 2 votes vote down vote up
/**
 * set message to newMessage with severity WARNING.
 * overwrite existing message only if it is beyond severity WARNING
 * @param newMessage the warning to be set
 */
private void setWarningMessage(String newMessage) {
	if (getMessage() == null || getMessageType() < IMessageProvider.WARNING)
		setMessage(newMessage, IMessageProvider.WARNING);
}