List of usage examples for org.eclipse.jface.dialogs IMessageProvider NONE
int NONE
To view the source code for org.eclipse.jface.dialogs IMessageProvider NONE.
Click Source Link
From source file:org.eclipse.xtext.xtext.ui.wizard.project.StatusWidget.java
License:Open Source License
public Procedure0 clearStatus() { final Procedure0 _function = () -> { };/*ww w. j a v a 2s .c o m*/ final Procedure0 _function_1 = () -> { }; return this.setStatus(IMessageProvider.NONE, "\n\n\n", _function, _function_1); }
From source file:org.eclipse.xtext.xtext.ui.wizard.project.StatusWidget.java
License:Open Source License
public Procedure0 setStatus(final int severity, final String text, final Procedure0 quickFix, final Procedure0 callback) { Procedure0 _xblockexpression = null; {/* w w w.ja v a 2 s.c o m*/ this.severity = severity; this.setVisible((severity != IMessageProvider.NONE)); this.imageLabel.setImage(this.imageFor(severity)); this.link.setText(text); final Matcher matcher = Pattern.compile("<a>(.*)</a>").matcher(text.trim()); this.link.setToolTipText(matcher.replaceAll("$1")); final Procedure0 _function = () -> { quickFix.apply(); callback.apply(); }; _xblockexpression = this.quickFix = _function; } return _xblockexpression; }
From source file:org.eclipse.xtext.xtext.ui.wizard.project.StatusWidget.java
License:Open Source License
public Procedure0 addStatus(final int severity, final String text) { Procedure0 _xifexpression = null;//from ww w.ja va 2 s . c o m boolean _isEmpty = this.link.getText().trim().isEmpty(); if (_isEmpty) { final Procedure0 _function = () -> { }; final Procedure0 _function_1 = () -> { }; _xifexpression = this.setStatus(severity, text, _function, _function_1); } else { String _text = this.link.getText(); String _plus = (_text + "\n"); String _plus_1 = (_plus + text); this.link.setText(_plus_1); final Matcher matcher = Pattern.compile("<a>(.*)</a>").matcher(text.trim()); this.link.setToolTipText(matcher.replaceAll("$1")); if ((severity > this.severity)) { this.severity = severity; this.setVisible((severity != IMessageProvider.NONE)); this.imageLabel.setImage(this.imageFor(severity)); } } return _xifexpression; }
From source file:org.eclipse.xtext.xtext.ui.wizard.project.StatusWidget.java
License:Open Source License
private Image imageFor(final int type) { Image _switchResult = null;/*from www . ja v a2 s . c om*/ switch (type) { case IMessageProvider.NONE: _switchResult = null; break; case IMessageProvider.INFORMATION: _switchResult = JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_INFO); break; case IMessageProvider.WARNING: _switchResult = JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_WARNING); break; case IMessageProvider.ERROR: _switchResult = JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_ERROR); break; } return _switchResult; }
From source file:org.erlide.ui.prefs.plugin.EditorPreferencePage.java
License:Open Source License
/** * Applies the status to the status line of a dialog page. * /*from w ww.j a va 2s. c o m*/ * @param page * the dialog page * @param status * the status */ public static void applyToStatusLine(final DialogPage page, final 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; } }
From source file:org.erlide.ui.prefs.plugin.IndentationPreferencePage.java
License:Open Source License
/** * Applies the status to the status line of a dialog page. * /*from w w w . j a v a2s . c o m*/ * @param page * the dialog page * @param status * the status */ public void applyToStatusLine(final DialogPage page, final 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; } }
From source file:org.fornax.cartridges.sculptor.framework.richclient.controller.AbstractWizardController.java
License:Apache License
/** * /*ww w . j a va 2 s. c o m*/ * @return true if page is valid */ protected boolean updateValidationMessages() { boolean messageSet = false; IStatus statusParent = AggregateValidationStatus.getStatusMerged(getBindingContext().getBindings()); // Iter for errors for (IStatus statusChild : statusParent.getChildren()) { if (statusChild.getSeverity() == IStatus.ERROR) { presentation.setErrorMessage(statusChild.getMessage()); messageSet = true; if (statusChild.getException() != null) { statusChild.getException().printStackTrace(); } break; } } if (!messageSet) { presentation.clearErrorMessage(); // Iter for warnings for (IStatus statusChild : statusParent.getChildren()) { if (statusChild.getSeverity() == IStatus.WARNING) { presentation.setMessage(statusChild.getMessage(), IMessageProvider.WARNING); messageSet = true; break; } } } if (!messageSet) { // Iter for information for (IStatus statusChild : statusParent.getChildren()) { if (statusChild.getSeverity() == IStatus.INFO) { presentation.setMessage(statusChild.getMessage(), IMessageProvider.INFORMATION); messageSet = true; break; } } } if (!messageSet) { IStatus customValidationStatus = getValidationStatus(); if (customValidationStatus == null) { presentation.clearErrorMessage(); presentation.setMessage(null, IMessageProvider.NONE); } else if (customValidationStatus.getSeverity() == IStatus.ERROR) { presentation.setErrorMessage(customValidationStatus.getMessage()); } else if (customValidationStatus.getSeverity() == IStatus.WARNING) { presentation.setMessage(customValidationStatus.getMessage(), IMessageProvider.WARNING); } else if (customValidationStatus.getSeverity() == IStatus.INFO) { presentation.setMessage(customValidationStatus.getMessage(), IMessageProvider.INFORMATION); } } if (!messageSet) { presentation.setMessage(null, IMessageProvider.NONE); } return !presentation.hasErrorMessage(); }
From source file:org.franca.core.ui.addons.wizard.StatusWizardPage.java
License:Open Source License
/** * Applies the status to the status line of the wizard page. * @param status the status to apply/*from www . ja va 2s .com*/ */ protected void applyStatus(IStatus status) { String msg = status.getMessage(); if (msg != null && msg.length() == 0) { msg = null; } switch (status.getSeverity()) { case IStatus.OK: setMessage(msg, IMessageProvider.NONE); setErrorMessage(null); break; case IStatus.WARNING: setMessage(msg, IMessageProvider.WARNING); setErrorMessage(null); break; case IStatus.INFO: setMessage(msg, IMessageProvider.INFORMATION); setErrorMessage(null); break; default: setMessage(null); setErrorMessage(msg); break; } }
From source file:org.fusesource.ide.camel.editor.preferences.PreferredLabelDialog.java
License:Open Source License
public void setWarning(String msg) { Button okButton = getButton(IDialogConstants.OK_ID); if (okButton != null) { setMessage(msg, msg == null ? IMessageProvider.NONE : IMessageProvider.WARNING); okButton.setEnabled(msg == null); }/*from w w w. j ava 2 s. c om*/ }
From source file:org.fusesource.ide.preferences.StagingRepositoryDialog.java
License:Open Source License
private void resetMessage() { isValid(); setErrorMessage(null); setMessage(Messages.newRepoDialogMessage, IMessageProvider.NONE); }