org.eclipse.ui.forms.IMessage Java Examples

The following examples show how to use org.eclipse.ui.forms.IMessage. 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: ConfigurationWizardDialog.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void updateMessage() {
    super.updateMessage();
    if (getCurrentPage() instanceof IProcessConfigurationWizardPage) {
        String errorMessage = ((IProcessConfigurationWizardPage) getCurrentPage())
                .isConfigurationPageValid(getConfiguration());
        if (errorMessage != null) {
            setMessage(errorMessage, IMessage.WARNING);
        } else {
            setMessage(getCurrentPage().getDescription());
        }
    }

    if (pageChooserViewer != null) {
        pageChooserViewer.refresh();
    }
}
 
Example #2
Source File: StatusToMessageSeverity.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
public int toMessageSeverity() {
    switch (status.getSeverity()) {
        case IStatus.OK:
            return IMessage.NONE;
        case IStatus.ERROR:
            return IMessage.ERROR;
        case IStatus.WARNING:
            return IMessage.WARNING;
        case IStatus.INFO:
            return IMessage.INFORMATION;
        default:
            throw new IllegalArgumentException("Unsupported status severity code: " + status.getSeverity());
    }
}
 
Example #3
Source File: GlobalParameterInfoPage.java    From olca-app with Mozilla Public License 2.0 5 votes vote down vote up
private void evalFormulas() {
	form.getMessageManager().removeAllMessages();
	List<String> errors = Formulas.eval(parameters);
	hasErrors = errors.size() > 0;
	for (String error : errors)
		form.getMessageManager()
				.addMessage("invalidFormula", M.InvalidFormula + ": " + error, null, IMessage.ERROR);
}
 
Example #4
Source File: StatusToMessageSeverityTest.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
@Test
public void should_convert_error_status_severity_to_error_message_severity() throws Exception {
    assertThat(new StatusToMessageSeverity(ValidationStatus.error("an error message")).toMessageSeverity()).isEqualTo(IMessage.ERROR);
}
 
Example #5
Source File: StatusToMessageSeverityTest.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
@Test
public void should_convert_warning_status_severity_to_warning_message_severity() throws Exception {
    assertThat(new StatusToMessageSeverity(ValidationStatus.warning("a warning message")).toMessageSeverity()).isEqualTo(IMessage.WARNING);
}
 
Example #6
Source File: StatusToMessageSeverityTest.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
@Test
public void should_convert_info_status_severity_to_info_message_severity() throws Exception {
    assertThat(new StatusToMessageSeverity(ValidationStatus.info("an info message")).toMessageSeverity()).isEqualTo(IMessage.INFORMATION);
}
 
Example #7
Source File: StatusToMessageSeverityTest.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
@Test
public void should_convert_ok_status_severity_to_none_message_severity() throws Exception {
    assertThat(new StatusToMessageSeverity(Status.OK_STATUS).toMessageSeverity()).isEqualTo(IMessage.NONE);
}