org.eclipse.jface.dialogs.IMessageProvider Java Examples

The following examples show how to use org.eclipse.jface.dialogs.IMessageProvider. 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: OutputColumnDefnPage.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
protected void doEdit( )
{
	int index = viewer.getViewer( ).getTable( ).getSelectionIndex( );
	if ( index >= 0 && index < viewer.getViewer( ).getTable( ).getItemCount( ) )
	{
		ColumnDefn currentColumn = (ColumnDefn) viewer.getViewer( ).getTable( )
				.getItem( index )
				.getData( );
		String oldName = currentColumn.getColumnName( );
		ColumnInputDialog inputDialog = new ColumnInputDialog( viewer.getControl( ).getShell( ),
				Messages.getString( "ResultSetColumnPage.inputDialog.editColumn.title" ), //$NON-NLS-1$
				currentColumn );
		if ( inputDialog.open( ) == Window.OK )
		{
			updateColumnDefMap( oldName, inputDialog.getColumnDefn( ) );
			viewer.getViewer( ).refresh( );
			updateMessage( );
		}
	}
	else
	{
		getContainer( ).setMessage( Messages.getString( "OutputColumnPage.error.invalidSelection" ), IMessageProvider.ERROR ); //$NON-NLS-1$
	}
	updateButtons( );
}
 
Example #2
Source File: IssueInformationPage.java    From sarl with Apache License 2.0 6 votes vote down vote up
/** Update the page status and change the "finish" state button.
 */
protected void updatePageStatus() {
	final boolean ok;
	if (Strings.isEmpty(this.titleField.getText())) {
		ok = false;
		setMessage(Messages.IssueInformationPage_5, IMessageProvider.ERROR);
	} else if (Strings.isEmpty(this.trackerLogin.getText())) {
		ok = false;
		setMessage(Messages.IssueInformationPage_6, IMessageProvider.ERROR);
	} else if (Strings.isEmpty(this.trackerPassword.getText())) {
		ok = false;
		setMessage(Messages.IssueInformationPage_7, IMessageProvider.ERROR);
	} else {
		ok = true;
		if (Strings.isEmpty(this.descriptionField.getText())) {
			setMessage(Messages.IssueInformationPage_8, IMessageProvider.WARNING);
		} else {
			setMessage(null, IMessageProvider.NONE);
		}
	}
	setPageComplete(ok);
}
 
Example #3
Source File: WizardResourceSettingPage.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Applies the status to the status line of a dialog page.
 */
private void applyToStatusLine( IStatus status )
{
	String message = status.getMessage( );
	if ( message.length( ) == 0 )
		message = PAGE_DESC;
	switch ( status.getSeverity( ) )
	{
		case IStatus.OK :
			setErrorMessage( null );
			setMessage( message );
			break;
		case IStatus.ERROR :
			setErrorMessage( message );
			setMessage( message, IMessageProvider.ERROR );
			break;
		default :
			setErrorMessage( message );
			setMessage( null );
			break;
	}
}
 
Example #4
Source File: ICEFormEditor.java    From ice with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * This operation changes the dirty state of the FormEditor.
 * 
 * @param value
 */
public void setDirty(boolean value) {

	// Set the dirty value and fire a property change
	dirty = value;
	firePropertyChange(PROP_DIRTY);

	// Push a message to the message manager
	if (getHeaderForm() != null) {
		final IMessageManager messageManager = getHeaderForm()
				.getMessageManager();
		if (dirty) {
			messageManager.addMessage("statusUpdate",
					"There are unsaved changes on the form.", null,
					IMessageProvider.WARNING);
		} else {
			messageManager.removeMessage("statusUpdate");
			// messageManager.addMessage("statusUpdate", "Form Saved", null,
			// IMessageProvider.INFORMATION);
		}
	}

}
 
Example #5
Source File: CommonGui.java    From CodeCheckerEclipsePlugin with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Tries to find a CodeChecker package.
 */
public void locateCodeChecker() {
    CodeCheckerLocatorService serv = null;
    switch (currentResMethod) {
        case PATH:
            serv = new EnvCodeCheckerLocatorService();
            break;
        case PRE:
            serv = new PreBuiltCodeCheckerLocatorService();
            break;
        default:
            break;
    }
    ICodeChecker cc = null;
    try {
        cc = serv.findCodeChecker(Paths.get(codeCheckerDirectoryField.getText()),
                new CodeCheckerFactory(), new ShellExecutorHelperFactory());
        form.setMessage(VALID_PACKAGE + cc.getLocation().toString(), IMessageProvider.INFORMATION);
        if (globalGui || (!globalGui && !useGlobalSettings))
            recursiveSetEnabled(checkerConfigSection, true);
    } catch (InvalidCodeCheckerException | IllegalArgumentException | ArrayIndexOutOfBoundsException e) {
        recursiveSetEnabled(checkerConfigSection, false);
        form.setMessage(e.getMessage(), IMessageProvider.ERROR);
    }
    this.codeChecker = cc;
}
 
Example #6
Source File: LoginDialog.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
private void update ()
{
    final Button button = getButton ( OK );
    try
    {
        setMessage ( Messages.LoginDialog_DefaultMessage, IMessageProvider.INFORMATION );
        validate ();

        button.setEnabled ( true );
    }
    catch ( final Exception e )
    {
        button.setEnabled ( false );
        setMessage ( e.getMessage (), IMessageProvider.ERROR );
    }

}
 
Example #7
Source File: ExtractConstantWizard.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected void addUserInputPages() {

	String message= null;
	int messageType= IMessageProvider.NONE;
	if(!getExtractConstantRefactoring().selectionAllStaticFinal()) {
		message= RefactoringMessages.ExtractConstantInputPage_selection_refers_to_nonfinal_fields;
		messageType= IMessageProvider.INFORMATION;
	} else {
		message= MESSAGE;
		messageType= IMessageProvider.NONE;
	}

	String[] guessedNames= getExtractConstantRefactoring().guessConstantNames();
	String initialValue= guessedNames.length == 0 ? "" : guessedNames[0]; //$NON-NLS-1$
	addPage(new ExtractConstantInputPage(message, messageType, initialValue, guessedNames));
}
 
Example #8
Source File: TSWizardDialog.java    From translationstudio8 with GNU General Public License v2.0 6 votes vote down vote up
public void updateMessage() {

		if (currentPage == null) {
			return;
		}

		pageMessage = currentPage.getMessage();
		if (pageMessage != null && currentPage instanceof IMessageProvider) {
			pageMessageType = ((IMessageProvider) currentPage).getMessageType();
		} else {
			pageMessageType = IMessageProvider.NONE;
		}
		if (pageMessage == null) {
			setMessage(pageDescription);
		} else {
			setMessage(pageMessage, pageMessageType);
		}
		setErrorMessage(currentPage.getErrorMessage());
	}
 
Example #9
Source File: AbstractN4JSPreferencePage.java    From n4js with Eclipse Public License 1.0 6 votes vote down vote up
/** 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 #10
Source File: DiscreteEntryComposite.java    From ice with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * This operation will post a message to the message manager (if one exists)
 * if the Entry has no value, but requires a value from a discrete set.
 */
private void throwMissingValuesError() {

	if (messageManager != null) {
		// Get the message
		String errorMessage = "There are no allowed values, can't create DiscreteEntryComposite.";// entry.getErrorMessage();
		// Post it if it exists
		if (errorMessage != null) {
			// Display the error at the top of the screen
			if (messageManager != null) {
				messageManager.addMessage(messageName, errorMessage, null, IMessageProvider.ERROR);
			}
			// Highlight the text if it is in a text box
			if (widget != null) {
				Color color = new Color(Display.getCurrent(), 200, 0, 0);
				widget.setForeground(color);
				FontData fontData = new FontData();
				fontData.setStyle(SWT.BOLD);
				Font font = new Font(getDisplay(), fontData);
				widget.setFont(font);
			}
		}
	}

	return;
}
 
Example #11
Source File: StatusUtil.java    From editorconfig-eclipse with Apache License 2.0 6 votes vote down vote up
/**
 * 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 #12
Source File: WizardLibrarySettingPage.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Applies the status to the status line of a dialog page.
 */
private void applyToStatusLine( IStatus status )
{
	String message = status.getMessage( );
	if ( message.length( ) == 0 )
		message = PAGE_DESC;
	switch ( status.getSeverity( ) )
	{
		case IStatus.OK :
			setErrorMessage( null );
			setMessage( message );
			break;
		case IStatus.ERROR :
			setErrorMessage( message );
			setMessage( message, IMessageProvider.ERROR );
			break;
		default :
			setErrorMessage( message );
			setMessage( null );
			break;
	}
}
 
Example #13
Source File: DartLog.java    From dartboard with Eclipse Public License 2.0 6 votes vote down vote up
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 #14
Source File: AbstractSREInstallPage.java    From sarl with Apache License 2.0 6 votes vote down vote up
/**
 * Updates the status message on the page, based on the status of the SRE and other
 * status provided by the page.
 */
protected void updatePageStatus() {
	if (this.status.isOK()) {
		setMessage(null, IMessageProvider.NONE);
	} else {
		switch (this.status.getSeverity()) {
		case IStatus.ERROR:
			setMessage(this.status.getMessage(), IMessageProvider.ERROR);
			break;
		case IStatus.INFO:
			setMessage(this.status.getMessage(), IMessageProvider.INFORMATION);
			break;
		case IStatus.WARNING:
			setMessage(this.status.getMessage(), IMessageProvider.WARNING);
			break;
		default:
			break;
		}
	}
	setPageComplete(this.status.isOK() || this.status.getSeverity() == IStatus.INFO);
}
 
Example #15
Source File: PropertyAndPreferencePage.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
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 #16
Source File: SymbolProviderConfigDialog.java    From tracecompass with Eclipse Public License 2.0 6 votes vote down vote up
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 #17
Source File: TemplateParameterPage.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
@Override
public void setStatus(IStatus status) {
	if (status == null || status.getSeverity() == IStatus.OK) {
		setErrorMessage(null);
		setMessage(null);
		setPageComplete(true);
	} else if (status.getSeverity() == IStatus.ERROR) {
		setErrorMessage(status.getMessage());
		setPageComplete(false);
	} else if (status.getSeverity() == IStatus.WARNING) {
		setErrorMessage(null);
		setMessage(status.getMessage(), IMessageProvider.WARNING);
		setPageComplete(true);
	} else {
		setErrorMessage(null);
		setMessage(status.getMessage(), IMessageProvider.INFORMATION);
		setPageComplete(true);
	}
}
 
Example #18
Source File: TemplateCustomPropertiesPage.java    From M2Doc with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void createControl(Composite parent) {

    final Composite container = new Composite(parent, parent.getStyle());
    setControl(container);
    container.setLayout(new GridLayout(1, false));

    final TabFolder tabFolder = new TabFolder(container, SWT.BORDER);
    tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

    final CheckboxTableViewer tokenViewer = addTokenTabItem(tabFolder, registry, properties);
    addNSURITabItem(tabFolder, tokenViewer, properties);
    addServicesTabItem(tabFolder, tokenViewer, properties);
    if (!M2DocUtils.VERSION.equals(properties.getM2DocVersion())) {
        setMessage("M2Doc version mismatch: template version is " + properties.getM2DocVersion()
            + " and current M2Doc version is " + M2DocUtils.VERSION, IMessageProvider.WARNING);
    } else {
        setMessage("Select services and packages");
    }
}
 
Example #19
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 #20
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 #21
Source File: DataSetComputedColumnsPage.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
protected void updateComputedColumn( Object structureOrHandle )
{
	if ( structureOrHandle instanceof ComputedColumn )
	{
		try
		{
			computedColumns.addItem( (ComputedColumn) structureOrHandle );
			viewer.getViewer( ).refresh( );
		}
		catch ( SemanticException e )
		{
			ExceptionHandler.handle( e );
		}
	}
	else
	{
		viewer.getViewer( ).update( structureOrHandle, null );
	}

	if ( validateAllComputedColumns( ) )
		getContainer( ).setMessage( Messages.getString( "dataset.editor.computedColumns" ), //$NON-NLS-1$
				IMessageProvider.NONE );
	
}
 
Example #22
Source File: StatusWidget.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
public Procedure0 addStatus(int severity, String text) {
	Procedure0 status = null;
	if (link.getText().trim().isEmpty()) {
		status = setStatus(severity, text, () -> {}, () -> {});
	} else {
		link.setText(link.getText() + "\n" + text);
		Matcher matcher = ANCHOR_PATTERN.matcher(text.trim());
		link.setToolTipText(matcher.replaceAll("$1"));
		if (severity > this.severity) {
			this.severity = severity;
			setVisible(severity != IMessageProvider.NONE);
			imageLabel.setImage(imageFor(severity));
		}
	}
	return status;
}
 
Example #23
Source File: AlwStartPage.java    From XPagesExtensionLibrary with Apache License 2.0 6 votes vote down vote up
protected AlwStartPage() {
    super("");
    setTitle("Application Layout");             // $NLX-AlwStartPage.ApplicationLayout-1$
    setMessage("Choose the configuration for this control.", IMessageProvider.INFORMATION); // $NLX-AlwStartPage.Choosetheconfigurationforthiscont-1$

    // Setup the title font
    _titleFont = JFaceResources.getBannerFont();
    
    // Setup hand cursor
    _handCursor = new Cursor(Display.getCurrent(), SWT.CURSOR_HAND);
    
    // Load images - Do not have to be disposed later - plugin maintains a list
    _defImage = ExtLibToolingPlugin.getImage("app_layout.jpg"); // $NON-NLS-1$
    if (_showResponsiveIcon) {
        _responsiveImage = NavigatorPlugin.getImage("navigatorIcons/navigatorChild.png"); // $NON-NLS-1$
    } else {
        _responsiveImage = null;
    }
    
    // Setup hyperlink color
    _hyperlinkColor = new Color(Display.getCurrent(), 0, 0, 255);
}
 
Example #24
Source File: MavenCoordinatesWizardUi.java    From google-cloud-eclipse with Apache License 2.0 6 votes vote down vote up
/**
 * 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 #25
Source File: DataSetComputedColumnsPage.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
private boolean validateSingleColumn( ComputedColumn computedColumn )
{
	if ( computedColumn.getName( ) == null
			|| computedColumn.getName( ).trim( ).length( ) == 0 )
	{
		getContainer( ).setMessage( Messages.getFormattedString( "dataset.editor.error.missingComputedColumnName", new Object[]{computedColumn.getName( )} ), IMessageProvider.ERROR ); //$NON-NLS-1$
		return false;
	}

	Iterator iter = ( (DataSetHandle) getContainer( ).getModel( ) ).getPropertyHandle( DataSetHandle.COLUMN_HINTS_PROP )
			.iterator( );
	while ( iter.hasNext( ) )
	{
		ColumnHintHandle hint = (ColumnHintHandle) iter.next( );
		if ( !computedColumn.getName( ).equals( hint.getColumnName( ) )
				&& computedColumn.getName( ).equals( hint.getAlias( ) ) )
		{
			getContainer( ).setMessage( Messages.getFormattedString( "dataset.editor.error.computedColumnNameAlreadyUsed", new Object[]{computedColumn.getName( )} ), IMessageProvider.ERROR ); //$NON-NLS-1$
			return false;
		}
	}
	return true;
}
 
Example #26
Source File: AbstractPydevPrefs.java    From Pydev with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * 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 #27
Source File: AreaPreferencePageTest.java    From google-cloud-eclipse with Apache License 2.0 6 votes vote down vote up
@Test
public void testStatusSeverityWarn() {
  // add three areas, status = OK, WARN, INFO; verify showing WARN
  setupAreas();

  area3.status = new Status(IStatus.INFO, "foo", "info3");
  area3.fireValueChanged(TestPrefArea.IS_VALID, true, false);

  assertTrue("should still be valid", page.isValid());
  assertEquals(IMessageProvider.INFORMATION, page.getMessageType());
  assertEquals("info3", page.getMessage());

  area2.status = new Status(IStatus.WARNING, "foo", "warn2");
  area2.fireValueChanged(TestPrefArea.IS_VALID, true, false);

  assertTrue("should still be valid", page.isValid());
  assertEquals(IMessageProvider.WARNING, page.getMessageType());
  assertEquals("warn2", page.getMessage());
}
 
Example #28
Source File: AbstractWizardPage.java    From tm4e with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * 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 #29
Source File: BasicFormPage.java    From tlaplus with MIT License 5 votes vote down vote up
public void addGlobalTLCErrorMessage(String key, String message)
{
	IMessageManager mm = getManagedForm().getMessageManager();
    mm.addMessage(key, message, null, IMessageProvider.WARNING);
    /*globalTLCErrorHyperLink.setText(TLC_ERROR_STRING);
    globalTLCErrorHyperLink.setToolTipText(tooltipText);
    globalTLCErrorHyperLink.setForeground(TLCUIActivator.getColor(SWT.COLOR_DARK_YELLOW));
    globalTLCErrorHyperLink.addHyperlinkListener(globalTLCErrorHyperLinkListener);*/
}
 
Example #30
Source File: DynamicWorkingSetPagePDETest.java    From eclipse-extras with Eclipse Public License 1.0 5 votes vote down vote up
@Test
public void testEnterPattern() {
  page.setSelection( createWorkingSet() );
  page.createControl( displayHelper.createShell() );
  page.setVisible( true );

  page.patternText.setText( "pattern" );

  assertThat( page.getMessage() ).isNotEmpty();
  assertThat( page.getMessageType() ).isEqualTo( IMessageProvider.ERROR );
  assertThat( page.isPageComplete() ).isFalse();
}