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.emf.example.databinding.project.ui.rcp.views.ProjectFormAreaPart.java
License:Open Source License
private int convertType(int severity) { switch (severity) { case IStatus.OK: return IMessageProvider.NONE; case IStatus.CANCEL: return IMessageProvider.NONE; case IStatus.INFO: return IMessageProvider.INFORMATION; case IStatus.WARNING: return IMessageProvider.WARNING; case IStatus.ERROR: return IMessageProvider.ERROR; default:/*from w w w .j av a 2s. c o m*/ return IMessageProvider.NONE; } }
From source file:org.eclipse.emf.oda.ecore.ui.impl.EcoreDataSourcePageHelper.java
License:Open Source License
/** * Validates that the user has specified values for the properties in the page control * and sets page message accordingly.//w w w . jav a 2 s .co m */ protected void validateData() { String resource = getResource(); boolean isValid = !StringUtil.isEmpty(resource); if (isValid) { try { URI.createURI(resource); setMessage(DEFAULT_MESSAGE, IMessageProvider.NONE); } catch (Exception e) { setMessage(e.getLocalizedMessage(), IMessageProvider.ERROR); } } else { setMessage(ODAEcoreUIPlugin.INSTANCE.getString("_UI_ResourceCannotBeEmpty_message"), //$NON-NLS-1$ IMessageProvider.ERROR); } setPageComplete(isValid); }
From source file:org.eclipse.epp.internal.mpc.ui.wizards.FeatureSelectionWizardPage.java
License:Open Source License
void updateMessage() { ProfileChangeOperation profileChangeOperation = getWizard().getProfileChangeOperation(); if (profileChangeOperation != null) { IStatus resolutionResult = profileChangeOperation.getResolutionResult(); if (!resolutionResult.isOK()) { String message = resolutionResult.getMessage(); if (resolutionResult.getSeverity() == IStatus.ERROR) { message = Messages.FeatureSelectionWizardPage_provisioningErrorAdvisory; } else if (resolutionResult.getSeverity() == IStatus.WARNING) { message = Messages.FeatureSelectionWizardPage_provisioningWarningAdvisory; }/*from w w w .j a v a 2 s . c om*/ setMessage(message, Util.computeMessageType(resolutionResult)); // avoid gratuitous scrolling String originalText = detailStatusText.getText(); String newText; try { newText = profileChangeOperation.getResolutionDetails(); } catch (Exception e) { // sometimes p2 might throw an exception MarketplaceClientUi.error(e); newText = Messages.FeatureSelectionWizardPage_detailsUnavailable; } if (newText != originalText || (newText != null && !newText.equals(originalText))) { detailStatusText.setText(newText); } ((GridData) detailsControl.getLayoutData()).exclude = false; } else { setMessage(null, IMessageProvider.NONE); ((GridData) detailsControl.getLayoutData()).exclude = true; } } else { setMessage(null, IMessageProvider.NONE); ((GridData) detailsControl.getLayoutData()).exclude = true; } ((Composite) getControl()).layout(true); }
From source file:org.eclipse.epp.internal.mpc.ui.wizards.MarketplacePage.java
License:Open Source License
private void computeStatusMessage() { String message = null;//from w w w .j ava2 s . co m int messageType = IMessageProvider.NONE; if (getWizard() != null) { IStatus viability = getWizard().getSelectionModel().computeProvisioningOperationViability(); if (viability != null) { message = viability.getMessage(); messageType = Util.computeMessageType(viability); } } setMessage(message, messageType); }
From source file:org.eclipse.equinox.internal.p2.ui.dialogs.ResolutionStatusPage.java
License:Open Source License
/** * Update the status area of the wizard to report the results of the operation. * //from ww w. j ava 2 s . com * @param newRoot the root that describes the root IUs involved in creating the plan. * This can be <code>null</code> if the root should not be updated. * * @param op the ProfileChangeOperation that describes the operation */ public void updateStatus(IUElementListRoot newRoot, ProfileChangeOperation op) { IStatus currentStatus = getProvisioningWizard().getCurrentStatus(); updateCaches(newRoot, op); int messageType = IMessageProvider.NONE; boolean pageComplete = op != null; if (currentStatus != null && !currentStatus.isOK()) { messageType = IMessageProvider.INFORMATION; int severity = currentStatus.getSeverity(); if (severity == IStatus.ERROR) { messageType = IMessageProvider.ERROR; pageComplete = false; // Log errors for later support ProvUI.reportStatus(currentStatus, StatusManager.LOG); } else if (severity == IStatus.WARNING) { messageType = IMessageProvider.WARNING; // Log warnings for later support ProvUI.reportStatus(currentStatus, StatusManager.LOG); } else if (severity == IStatus.CANCEL) { pageComplete = shouldCompleteOnCancel(); } } setPageComplete(pageComplete); if (!isCreated()) return; setMessage(getMessageText(currentStatus), messageType); setDetailText(op); }
From source file:org.eclipse.equinox.internal.security.ui.storage.ChallengeResponseDialog.java
License:Open Source License
protected Control createDialogArea(Composite parent) { Composite compositeTop = (Composite) super.createDialogArea(parent); setTitle(SecUIMessages.passwordRecoveryTitleMsg); Composite composite = new Composite(compositeTop, SWT.NONE); setMessage(SecUIMessages.passwordMsg, IMessageProvider.NONE); Label storyLabel = new Label(composite, SWT.WRAP); GridData labelData = new GridData(SWT.FILL, SWT.BEGINNING, true, false); labelData.widthHint = 500;/*from w w w . java 2 s . c o m*/ storyLabel.setLayoutData(labelData); storyLabel.setText(SecUIMessages.passwordRecoveryLabel); for (int i = 0; i < size; i++) { Group group = new Group(composite, SWT.NONE); group.setText(NLS.bind(SecUIMessages.passwordGroup, Integer.toString(i + 1))); group.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false)); group.setLayout(new GridLayout(2, false)); new Label(group, SWT.LEFT).setText(SecUIMessages.passwordQuestion); questions[i] = new Text(group, SWT.LEFT | SWT.BORDER); questions[i].setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false)); questions[i].addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent event) { validateOK(); } }); new Label(group, SWT.LEFT).setText(SecUIMessages.passwordAnswer); answers[i] = new Text(group, SWT.LEFT | SWT.BORDER); answers[i].setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false)); answers[i].addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent event) { validateOK(); } }); } composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); GridLayoutFactory.swtDefaults().generateLayout(composite); return composite; }
From source file:org.eclipse.equinox.internal.security.ui.storage.ChallengeResponseDialog.java
License:Open Source License
protected void validateOK() { boolean valid = true; for (int i = 0; i < size; i++) { if (questions[i] == null) continue; String question = questions[i].getText(); if (question == null || question.length() == 0) { valid = false;//w ww . j a v a 2 s .co m break; } if (answers[i] == null) continue; String answer = answers[i].getText(); if (answer == null || answer.length() == 0) { valid = false; break; } } if (valid) setMessage(SecUIMessages.passwordMsg, IMessageProvider.NONE); else setMessage(SecUIMessages.passwordErrMsg, IMessageProvider.WARNING); okButton.setEnabled(valid); }
From source file:org.eclipse.equinox.internal.security.ui.storage.StorageLoginDialog.java
License:Open Source License
protected boolean validatePassword() { String password1 = password.getText(); if ((password1 == null) || (password1.length() == 0)) { setMessage(SecUIMessages.messageEmptyPassword, IMessageProvider.ERROR); return false; }/* ww w. ja v a 2 s .c o m*/ if (confirm != null) { String password2 = confirm.getText(); if (!password1.equals(password2)) { setMessage(SecUIMessages.messageNoMatch, IMessageProvider.WARNING); return false; } } setMessage("", IMessageProvider.NONE); //$NON-NLS-1$ return true; }
From source file:org.eclipse.equinox.internal.security.ui.storage.view.NewNodeDialog.java
License:Open Source License
protected boolean validName() { String tmp = nodeName.getText(); boolean valid; if ((tmp == null) || (tmp.length() == 0)) valid = false;/*from w w w. java 2 s.c o m*/ else if (tmp.equals(IStorageConst.STORAGE_ID)) valid = false; else valid = (tmp.indexOf('/') == -1); if (valid) setMessage(SecUIMessages.newNodeMsg, IMessageProvider.NONE); else setMessage(SecUIMessages.newNodeInvalid, IMessageProvider.ERROR); return valid; }
From source file:org.eclipse.equinox.internal.security.ui.storage.view.NewValueDialog.java
License:Open Source License
protected boolean validName() { String tmp = keyText.getText(); boolean valid; if ((tmp == null) || (tmp.length() == 0)) valid = false;/*from w w w .j av a2s. co m*/ else { valid = true; for (int i = 0; i < existingKeys.length; i++) { if (existingKeys[i].equals(tmp)) { valid = false; break; } } valid = (tmp.indexOf('/') == -1); } if (valid) setMessage(SecUIMessages.addValueMsg, IMessageProvider.NONE); else setMessage(SecUIMessages.addValueInvalid, IMessageProvider.ERROR); return valid; }