List of usage examples for org.eclipse.jface.dialogs IMessageProvider WARNING
int WARNING
To view the source code for org.eclipse.jface.dialogs IMessageProvider WARNING.
Click Source Link
From source file:com.siteview.mde.internal.ui.editor.EditorUtilities.java
License:Open Source License
private static ImageData[] getImageData(IValidatorMessageHandler validator, FormEntry provider, IProduct product) {/* w w w .j a va2 s . c om*/ String imagePath = provider.getText().getText(); String message = null; try { IPath path = getFullPath(new Path(imagePath), product); URL url = new URL(path.toString()); ImageLoader loader = new ImageLoader(); InputStream stream = url.openStream(); ImageData[] idata = loader.load(stream); stream.close(); if (idata != null && idata.length > 0) return idata; message = MDEUIMessages.EditorUtilities_noImageData; } catch (SWTException e) { message = MDEUIMessages.EditorUtilities_pathNotValidImage; } catch (MalformedURLException e) { message = MDEUIMessages.EditorUtilities_invalidFilePath; } catch (IOException e) { message = MDEUIMessages.EditorUtilities_invalidFilePath; } validator.addMessage(message, IMessageProvider.WARNING); return null; }
From source file:com.siteview.mde.internal.ui.editor.monitor.ExtensionsSection.java
License:Open Source License
private void reportMissingExtensionPointSchema(String point) { getManagedForm().getMessageManager().addMessage(point, NLS.bind(MDEUIMessages.ManifestEditor_DetailExtension_missingExtPointSchema, point), null, IMessageProvider.WARNING); }
From source file:com.siteview.mde.internal.ui.editor.product.GeneralInfoSection.java
License:Open Source License
private void validateProductId() { String pluginId = getProduct().getDefiningPluginId(); IMessageManager messageManager = getManagedForm().getForm().getMessageManager(); if (pluginId != null && pluginId.equals(getProduct().getId())) { messageManager.addMessage(MDEUIMessages.GeneralInfoSection_IdWarning, MDEUIMessages.GeneralInfoSection_IdWarning, null, IMessageProvider.WARNING); } else {// w w w.j a v a 2s .c om messageManager.removeMessage(MDEUIMessages.GeneralInfoSection_IdWarning); } }
From source file:com.siteview.mde.internal.ui.editor.validation.AbstractControlValidator.java
License:Open Source License
public static int getMessageType(IStatus status) { int severity = status.getSeverity(); // Translate severity to the equivalent message provider type if (severity == IStatus.OK) { return IMessageProvider.NONE; } else if (severity == IStatus.ERROR) { return IMessageProvider.ERROR; } else if (severity == IStatus.WARNING) { return IMessageProvider.WARNING; } else if (severity == IStatus.INFO) { return IMessageProvider.INFORMATION; }/* w w w . j a v a2s . co m*/ // IStatus.CANCEL return IMessageProvider.NONE; }
From source file:com.siteview.mde.internal.ui.editor.validation.AbstractControlValidator.java
License:Open Source License
public static int getMessageType(IProject project, String compilerFlagId) { int severity = CompilerFlags.getFlag(project, compilerFlagId); // Translate severity to the equivalent message provider type if (severity == CompilerFlags.IGNORE) { return IMessageProvider.NONE; } else if (severity == CompilerFlags.ERROR) { return IMessageProvider.ERROR; } else {//from w ww. j av a2s . c om // CompilerFlags.WARNING return IMessageProvider.WARNING; } }
From source file:com.siteview.mde.internal.ui.samples.ProjectNamesPage.java
License:Open Source License
private void updateEntries() { IConfigurationElement selection = wizard.getSelection(); if (selection != null) { setMessage(null);/*from w w w . j av a 2 s.com*/ IConfigurationElement[] projects = selection.getChildren("project"); //$NON-NLS-1$ Control[] children = container.getChildren(); if (projects.length == 1 && children.length == 2) { Text text = (Text) children[1]; text.setText(projects[0].getAttribute("name")); //$NON-NLS-1$ validateEntries(); return; } // dispose all for (int i = 0; i < children.length; i++) { children[i].dispose(); } // create entries if (projects.length == 1) { createEntry(MDEUIMessages.ProjectNamesPage_projectName, projects[0].getAttribute("name")); //$NON-NLS-1$ } else { for (int i = 0; i < projects.length; i++) { String label = NLS.bind(MDEUIMessages.ProjectNamesPage_multiProjectName, "" + (i + 1)); //$NON-NLS-1$ createEntry(label, projects[i].getAttribute("name")); //$NON-NLS-1$ } } container.layout(); validateEntries(); } else { setMessage(MDEUIMessages.ProjectNamesPage_noSampleFound, IMessageProvider.WARNING); } }
From source file:com.siteview.mde.internal.ui.samples.ReviewPage.java
License:Open Source License
private void updateContent() { StringBuffer buf = new StringBuffer(); buf.append("<form>"); //$NON-NLS-1$ IConfigurationElement selection = wizard.getSelection(); if (selection != null) { setMessage(null);/*from w w w . j av a2 s.c om*/ IConfigurationElement[] desc = selection.getChildren("description"); //$NON-NLS-1$ if (desc.length == 1) buf.append(NLS.bind(MDEUIMessages.ReviewPage_descContent, (new String[] { selection.getAttribute("name"), desc[0].getValue() }))); //$NON-NLS-1$ else buf.append(NLS.bind(MDEUIMessages.ReviewPage_content, selection.getAttribute("name"))); //$NON-NLS-1$ } else { setMessage(MDEUIMessages.ReviewPage_noSampleFound, IMessageProvider.WARNING); } buf.append("</form>"); //$NON-NLS-1$ formText.setText(buf.toString()); }
From source file:com.siteview.mde.internal.ui.shared.target.EditDirectoryContainerPage.java
License:Open Source License
/** * Validate the input fields before a container is created/edited. * The page's enablement, message and completion should be updated. * /*from w w w. jav a 2 s.c o m*/ * @return whether the finish button should be enabled and container creation should continue */ protected boolean validateInput() { // Check if the text field is blank if (fInstallLocation.getText().trim().length() == 0) { setMessage(getDefaultMessage()); return false; } // Resolve any variables String locationString = null; try { locationString = VariablesPlugin.getDefault().getStringVariableManager() .performStringSubstitution(fInstallLocation.getText().trim()); } catch (CoreException e) { setMessage(e.getMessage(), IMessageProvider.WARNING); return true; } File location = new File(locationString); // Check if directory exists if (!location.isDirectory()) { setMessage(Messages.AddDirectoryContainerPage_6, IMessageProvider.WARNING); } else { setMessage(getDefaultMessage()); } return true; }
From source file:com.siteview.mde.internal.ui.shared.target.EditProfileContainerPage.java
License:Open Source License
protected boolean validateInput() { boolean valid = super.validateInput(); if (valid) {/*from ww w. j a v a 2s .c om*/ if (fConfigLocation.isEnabled()) { // Check if the text field is blank if (fConfigLocation.getText().trim().length() == 0) { setMessage(Messages.EditProfileContainerPage_2); return false; } // Resolve any variables String locationString = null; try { locationString = VariablesPlugin.getDefault().getStringVariableManager() .performStringSubstitution(fConfigLocation.getText().trim()); } catch (CoreException e) { setMessage(e.getMessage(), IMessageProvider.WARNING); return true; } File configLocation = new File(locationString); // Check that the directory exists if (!configLocation.isDirectory()) { setMessage(Messages.AddProfileContainerPage_8, IMessageProvider.WARNING); } else { setMessage(getDefaultMessage()); } } } return valid; }
From source file:com.siteview.mde.internal.ui.wizards.exports.BaseExportWizardPage.java
License:Open Source License
protected void pageChanged() { if (getMessage() != null) setMessage(null);// ww w.j a v a 2 s . c o m if (fOptionsTab != null) { String path = fOptionsTab.getAntBuildFileName(); String warningMessage = null; if (path != null && path.length() > 0 && "build.xml".equals(new Path(path).lastSegment())) //$NON-NLS-1$ warningMessage = MDEUIMessages.ExportOptionsTab_antReservedMessage; setMessage(warningMessage, IMessageProvider.WARNING); } String error = fExportPart.getSelectionCount() > 0 ? null : MDEUIMessages.ExportWizard_status_noselection; if (error == null) error = validateTabs(); setErrorMessage(error); setPageComplete(error == null); }