List of usage examples for org.eclipse.jface.dialogs IMessageProvider INFORMATION
int INFORMATION
To view the source code for org.eclipse.jface.dialogs IMessageProvider INFORMATION.
Click Source Link
From source file:org.eclipse.pde.internal.visualization.dependency.errors.ErrorReporting.java
License:Open Source License
/** * Shows the current selected error/*from w ww . ja v a 2s . co m*/ * @param view the view * @param currentError the current error * @param manager the message manager */ public static void showCurrentError(IDependencyVisualizationView view, ErrorReporting currentError, IMessageManager manager) { manager.removeAllMessages(); CurrentError currentErrorWrapper = new CurrentError(view, currentError.getVertex(), currentError); manager.addMessage(currentErrorWrapper, currentErrorWrapper.getErrorMessage(), currentErrorWrapper, IMessageProvider.INFORMATION); }
From source file:org.eclipse.pde.internal.visualization.dependency.views.VisualizationForm.java
License:Open Source License
private void configureFormText(final Form form, FormText text) { text.addHyperlinkListener(new HyperlinkAdapter() { public void linkActivated(HyperlinkEvent e) { String is = (String) e.getHref(); try { ((FormText) e.widget).getShell().dispose(); int index = Integer.parseInt(is); IMessage[] messages = form.getChildrenMessages(); IMessage message = messages[index]; ErrorReporting error = (ErrorReporting) message.getData(); if (error != null) { error.handleError(); }//from w w w . j a v a 2 s .co m } catch (NumberFormatException ex) { } } }); text.setImage("error", getImage(IMessageProvider.ERROR)); text.setImage("warning", getImage(IMessageProvider.WARNING)); text.setImage("info", getImage(IMessageProvider.INFORMATION)); }
From source file:org.eclipse.php.internal.debug.ui.wizards.PHPExeCompositeFragment.java
License:Open Source License
public void validate() { PHPexeItem phpExeItem = getPHPExeItem(); // Let's reset previous state setComplete(true);// w w w. j ava 2 s. c o m setMessage(PHPDebugUIMessages.PHPExeCompositeFragment_0, IMessageProvider.INFORMATION); /* MESSAGES */ // Check if PHP executable location is empty if (phpExeItem.getExecutable() == null || phpExeItem.getExecutable().getPath().length() == 0) { setMessage(PHPDebugUIMessages.addPHPexeDialog_enterLocation, IMessageProvider.INFORMATION); setComplete(false); return; } // Check if name is empty if (phpExeItem.getName().isEmpty()) { setMessage(PHPDebugUIMessages.addPHPexeDialog_enterName, IMessageProvider.INFORMATION); setComplete(false); return; } /* ERRORS */ // Check PHP executable if (phpExeItem.getExecutable() == null) { setMessage(PHPDebugUIMessages.PHPExeCompositeFragment_13, IMessageProvider.ERROR); return; } if (!phpExeItem.getExecutable().exists()) { setMessage(PHPDebugUIMessages.addPHPexeDialog_locationNotExists, IMessageProvider.ERROR); return; } PHPExeInfo phpExecInfo = getPHPInfo(phpExeItem.getExecutable()); if (phpExecInfo == null) { setMessage(PHPDebugUIMessages.PHPExeCompositeFragment_13, IMessageProvider.ERROR); return; } // Check whether the name already exists: if (existingItems != null) { for (PHPexeItem item : existingItems) { if (!item.getName().equals(initialName) && item.getName().equals(phpExeItem.getName())) { setMessage(PHPDebugUIMessages.addPHPexeDialog_duplicateName, IMessageProvider.ERROR); return; } } } // Check if SAPI type is provided if (phpExeItem.getSapiType().isEmpty()) { setMessage(PHPDebugUIMessages.PHPExeCompositeFragment_15, IMessageProvider.ERROR); return; } if (phpExecInfo.getSapiType() != null && !phpExeItem.getSapiType().equals(phpExecInfo.getSapiType())) { setMessage(MessageFormat.format(PHPDebugUIMessages.addPHPexeDialog_wrongSAPItype, phpExecInfo.getSapiType()), IMessageProvider.ERROR); return; } // Check INI file location if (phpExeItem.getINILocation() != null) { String iniLocationName = phpExeItem.getINILocation().getPath(); File iniFile = null; if (iniLocationName.trim().length() > 0) { iniFile = new File(iniLocationName); if (!iniFile.exists()) { setMessage(PHPDebugUIMessages.addPHPexeDialog_iniLocationNotExists, IMessageProvider.ERROR); return; } } } // Update control handler controlHandler.update(); }
From source file:org.eclipse.php.internal.debug.ui.wizards.PHPExeCompositeFragment.java
License:Open Source License
private void updateItem() { PHPexeItem phpExeItem = getPHPExeItem(); if (phpExeItem == null) return;/*ww w .j a v a 2 s .c o m*/ // Check whether we can edit this item if (phpExeItem != null && !phpExeItem.isEditable()) { setMessage(PHPDebugUIMessages.addPHPexeDialog_readOnlyPHPExe, IMessageProvider.INFORMATION); setComplete(false); // If it is not editable it doesn't mean that it is correct validate(); return; } // Set up PHP exe item. phpExeItem.setLoadDefaultINI(fLoadDefaultPHPIni.getSelection()); phpExeItem.setExecutable(fPHPExePath.getText().isEmpty() ? null : new File(fPHPExePath.getText())); phpExeItem.setName(fPHPexeName.getText()); phpExeItem.setINILocation(fPHPIni.getText().isEmpty() ? null : new File(fPHPIni.getText())); phpExeItem.setSapiType(fSapiTypes.getText()); PHPExeInfo phpExeInfo = getPHPInfo(phpExeItem.getExecutable()); if (phpExeInfo != null) { // Set up PHP exe item version phpExeItem.setVersion(phpExeInfo.getVersion()); } // Validate all validate(); }
From source file:org.eclipse.php.internal.server.ui.ServerEditDialog.java
License:Open Source License
public void setMessage(String newMessage, int newType) { // Override the WARNING with an INFORMATION. // We have a bug that cause the warning to be displayed in all the tabs // and not// www .ja v a 2 s. c om // only in the selected one. (TODO - Fix this) if (newType == IMessageProvider.WARNING) { newType = IMessageProvider.INFORMATION; } super.setMessage(newMessage, newType); }
From source file:org.eclipse.rap.demo.wizard.MoreInformationPage.java
License:Open Source License
/** * Creates the controls for this page// ww w. j a v a 2 s. co m */ public void createControl(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout(1, false)); new Label(composite, SWT.LEFT).setText("Please enter your complaints"); final Text text = new Text(composite, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL); text.setLayoutData(new GridData(GridData.FILL_BOTH)); text.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent event) { if (text.getText().length() > 0) { setMessage("Great!", IMessageProvider.INFORMATION); setPageComplete(true); } else { setMessage("Please enter your comment", IMessageProvider.WARNING); setPageComplete(false); } } }); setControl(composite); }
From source file:org.eclipse.reddeer.jface.test.dialogs.impl.TestingTitleAreaDialog.java
License:Open Source License
@Override protected Control createDialogArea(Composite parent) { Composite area = (Composite) super.createDialogArea(parent); Composite container = new Composite(area, SWT.NONE); container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); GridLayout layout = new GridLayout(2, false); container.setLayout(layout);// ww w . j av a2s.co m Button errorMessageButton = new Button(container, SWT.PUSH); errorMessageButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { setErrorMessage(ERROR_MESSAGE_WITHOUT_PROVIDER); } }); errorMessageButton.setText(ERROR_MESSAGE_WITHOUT_PROVIDER); Button warningButton = new Button(container, SWT.PUSH); warningButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { setMessage(WARNING_MESSAGE, IMessageProvider.WARNING); } }); warningButton.setText(WARNING_MESSAGE); Button infoButton = new Button(container, SWT.PUSH); infoButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { setMessage(INFO_MESSAGE, IMessageProvider.INFORMATION); } }); infoButton.setText(INFO_MESSAGE); Button noneButton = new Button(container, SWT.PUSH); noneButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { setMessage(NONE_MESSAGE, IMessageProvider.NONE); } }); noneButton.setText(NONE_MESSAGE); Button errorButton = new Button(container, SWT.PUSH); errorButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { setMessage(ERROR_MESSAGE, IMessageProvider.ERROR); } }); errorButton.setText(ERROR_MESSAGE); setTitleImage(Activator.getDefault().getImageRegistry().get(Activator.REDDEER_ICON)); return area; }
From source file:org.eclipse.scada.core.ui.connection.login.dialog.LoginDialog.java
License:Open Source License
private void update() { final Button button = getButton(OK); try {//from w ww . j a v a2 s . co m setMessage(Messages.LoginDialog_DefaultMessage, IMessageProvider.INFORMATION); validate(); button.setEnabled(true); } catch (final Exception e) { button.setEnabled(false); setMessage(e.getMessage(), IMessageProvider.ERROR); } }
From source file:org.eclipse.scada.da.client.dataitem.details.extra.part.VariantEntryDialog.java
License:Open Source License
@Override protected Control createDialogArea(final Composite parent) { final Control control = super.createDialogArea(parent); setMessage(Messages.VariantEntryDialog_Dialog_Message, IMessageProvider.INFORMATION); setTitle(Messages.VariantEntryDialog_Dialog_Title); getShell().setText(Messages.VariantEntryDialog_Dialog_Title); createEntryArea((Composite) control); return control; }
From source file:org.eclipse.sirius.diagram.ui.tools.api.wizards.page.DiagramSelectionWizardPage.java
License:Open Source License
private void initialize(final DView aRoot, final ViewerFilter aDiagramSelectionFilter) { this.root = aRoot; this.setPageComplete(false); this.diagramSelectionFilter = aDiagramSelectionFilter; setMessage(SELECT_DIAGRAMS_TO_EXPORT, IMessageProvider.INFORMATION); final StringBuilder title = new StringBuilder(); title.append(PAGE_TITLE);// w ww . j a v a2s.c om if (root.getViewpoint() != null && !StringUtil.isEmpty(new IdentifiedElementQuery(root.getViewpoint()).getLabel())) { title.append(" for "); title.append(new IdentifiedElementQuery(root.getViewpoint()).getLabel()); } this.setTitle(title.toString()); }