List of usage examples for org.eclipse.jface.dialogs Dialog DLG_IMG_MESSAGE_ERROR
String DLG_IMG_MESSAGE_ERROR
To view the source code for org.eclipse.jface.dialogs Dialog DLG_IMG_MESSAGE_ERROR.
Click Source Link
"dialog_message_error_image"
). From source file:org.eclipse.jst.jsf.common.ui.internal.dialogs.TreeViewerSelectionDialog.java
License:Open Source License
/** * Get the different message according the message type. * @param imageType //from w ww.j a va 2s.c o m * * @return Image - the message image */ protected Image getMessageImage(int imageType) { switch (imageType) { case STYLE_ERROR: return JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_ERROR); case STYLE_WARNING: return JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_WARNING); case STYLE_INFORMATION: return JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_INFO); default: return null; } }
From source file:org.eclipse.jst.jsf.facesconfig.ui.dialog.StatusDialog.java
License:Open Source License
protected Control createDialogArea(Composite parent) { Composite area = (Composite) super.createDialogArea(parent); area.setLayout(new GridLayout(2, false)); Composite contents = new Composite(area, SWT.NONE); GridData gd = new GridData(GridData.FILL_BOTH); gd.horizontalSpan = 2;/*from w w w. j a v a2s .c o m*/ contents.setLayoutData(gd); createDialogContents(contents); statusImage = createLabel(area); statusImage.setImage(JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_ERROR)); statusLabel = createLabel(area); statusImage.setVisible(false); return area; }
From source file:org.eclipse.m2e.core.ui.internal.util.M2EUIUtils.java
License:Open Source License
/** * @param shell//from ww w.j a va 2s. c o m * @param string * @param string2 * @param updateErrors */ public static void showErrorsForProjectsDialog(final Shell shell, final String title, final String message, final Map<String, Throwable> errorMap) { // TODO Auto-generated method showErrorsForProjectsDialog Display.getDefault().asyncExec(new Runnable() { public void run() { String[] buttons = { IDialogConstants.OK_LABEL }; int ok_button = 0; M2EErrorDialog errDialog = new M2EErrorDialog(shell, title, Dialog.getImage(Dialog.DLG_IMG_MESSAGE_ERROR), message, MessageDialog.ERROR, buttons, ok_button, errorMap); errDialog.create(); errDialog.open(); } }); }
From source file:org.eclipse.osee.framework.ui.skynet.artifact.editor.pages.ArtifactFormPage.java
License:Open Source License
private void updateArtifactInfoArea(FormToolkit toolkit, ScrolledForm form, boolean add) { if (add) {//from www . jav a 2 s . co m Composite infoArea = toolkit.createComposite(form.getForm().getBody(), SWT.WRAP); infoArea.setLayout(ALayout.getZeroMarginLayout(2, false)); infoArea.setLayoutData(new GridData(SWT.BEGINNING, SWT.FILL, true, false)); Label label = toolkit.createLabel(infoArea, "", SWT.WRAP); Image image; try { Artifact artifact = getEditor().getEditorInput().getArtifact(); if (artifact.isDeleted()) { image = ImageManager.getImage(FrameworkImage.TRASH); } else { image = Dialog.getImage(Dialog.DLG_IMG_MESSAGE_INFO); } } catch (Exception ex) { image = Dialog.getImage(Dialog.DLG_IMG_MESSAGE_ERROR); } label.setImage(image); infoText = toolkit.createFormText(infoArea, false); infoText.setText(getArtifactShortInfo(), true, false); infoText.setForeground(Displays.getSystemColor(SWT.COLOR_DARK_GRAY)); infoText.setToolTipText("The human readable id and database id for this artifact"); } else { infoText.setText(getArtifactShortInfo(), true, false); } }
From source file:org.eclipse.pde.internal.ui.editor.PDEFormPage.java
License:Open Source License
protected void createFormErrorContent(IManagedForm managedForm, String errorTitle, String errorMessage, Exception e) {// w w w .j av a 2 s . c om ScrolledForm form = managedForm.getForm(); FormToolkit toolkit = managedForm.getToolkit(); toolkit.decorateFormHeading(form.getForm()); Composite parent = form.getBody(); GridLayout layout = new GridLayout(); GridData data2 = new GridData(GridData.FILL_BOTH); layout.marginWidth = 7; layout.marginHeight = 7; parent.setLayout(layout); parent.setLayoutData(data2); // Set the title and image of the form form.setText(errorTitle); form.setImage(JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_ERROR)); int sectionStyle = Section.DESCRIPTION | ExpandableComposite.TITLE_BAR; // Create the message section Section messageSection = createUISection(parent, PDEUIMessages.PDEFormPage_titleMessage, errorMessage, sectionStyle); Composite messageClient = createUISectionContainer(messageSection, 1); // Bind the widgets toolkit.paintBordersFor(messageClient); messageSection.setClient(messageClient); // Ensure the exception was defined if (e == null) { return; } // Create the details section Section detailsSection = createUISection(parent, PDEUIMessages.PDEFormPage_titleDetails, e.getMessage(), sectionStyle); Composite detailsClient = createUISectionContainer(detailsSection, 1); // Create text widget holding the exception trace int style = SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.READ_ONLY; Text text = toolkit.createText(detailsClient, getStackTrace(e), style); GridData data = new GridData(GridData.FILL_HORIZONTAL); data.heightHint = 160; data.widthHint = 200; text.setLayoutData(data); // Bind the widgets toolkit.paintBordersFor(detailsClient); detailsSection.setClient(detailsClient); // Note: The veritical scrollbar fails to appear when text widget is // not entirely shown }
From source file:org.eclipse.reddeer.jface.test.dialogs.TitleAreaDialogTest.java
License:Open Source License
@Test public void titleAreaMessagesAndImages() { openTitleAreaDialog();/* www . j av a2 s. c om*/ TitleAreaDialogImpl dialog = new TitleAreaDialogImpl(); assertEquals(TestingTitleAreaDialog.DEFAULT_MESSAGE, dialog.getMessage()); assertEquals(MessageTypeEnum.NONE, dialog.getMessageType()); assertEquals(TestingTitleAreaDialog.TITLE, dialog.getTitle()); assertNull(dialog.getMessageImage()); assertEquals(Activator.getDefault().getImageRegistry().get(Activator.REDDEER_ICON), dialog.getTitleImage()); dialog.errorButton(); assertEquals(TestingTitleAreaDialog.ERROR_MESSAGE, dialog.getMessage()); assertEquals(MessageTypeEnum.ERROR, dialog.getMessageType()); assertEquals(JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_ERROR), dialog.getMessageImage()); dialog.warningButton(); assertEquals(TestingTitleAreaDialog.WARNING_MESSAGE, dialog.getMessage()); assertEquals(MessageTypeEnum.WARNING, dialog.getMessageType()); assertEquals(JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_WARNING), dialog.getMessageImage()); dialog.infoButton(); assertEquals(TestingTitleAreaDialog.INFO_MESSAGE, dialog.getMessage()); assertEquals(MessageTypeEnum.INFO, dialog.getMessageType()); assertEquals(JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_INFO), dialog.getMessageImage()); dialog.noneButton(); assertEquals(TestingTitleAreaDialog.NONE_MESSAGE, dialog.getMessage()); assertEquals(MessageTypeEnum.NONE, dialog.getMessageType()); assertNull(dialog.getMessageImage()); dialog.errorWithoutProviderButton(); assertEquals(TestingTitleAreaDialog.ERROR_MESSAGE_WITHOUT_PROVIDER, dialog.getMessage()); assertEquals(MessageTypeEnum.ERROR, dialog.getMessageType()); }
From source file:org.eclipse.scada.configuration.component.tools.wizard.PreviewPage.java
License:Open Source License
protected void renderResult(final ViewerCell cell, final Entry element) { if (element.getException() != null) { cell.setText(ExceptionHelper.getMessage(element.getException())); cell.setImage(JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_ERROR)); } else {/*from w w w . j a v a2 s .c o m*/ cell.setText(element.getNewName()); cell.setImage(null); } }
From source file:org.eclipse.swtbot.forms.finder.test.FormView.java
License:Open Source License
/** * This is a callback that will allow us to create the viewer and * initialize it.//from w ww .j a va 2 s. c o m */ public void createPartControl(Composite parent) { toolkit = new FormToolkit(parent.getDisplay()); form = toolkit.createScrolledForm(parent); form.setText("Hello, Eclipse Forms"); TableWrapLayout layout = new TableWrapLayout(); form.getBody().setLayout(layout); Hyperlink link = toolkit.createHyperlink(form.getBody(), "Click here.", SWT.WRAP); link.addHyperlinkListener(new HyperlinkAdapter() { public void linkActivated(HyperlinkEvent e) { System.out.println("Link activated!"); } }); link.setText("This is an example of a form that is much longer and will need to wrap."); layout.numColumns = 2; TableWrapData td = new TableWrapData(); td.colspan = 2; link.setLayoutData(td); toolkit.createLabel(form.getBody(), "Text field label:"); Text text = toolkit.createText(form.getBody(), ""); td = new TableWrapData(TableWrapData.FILL_GRAB); text.setLayoutData(td); Button button = toolkit.createButton(form.getBody(), "An example of a checkbox in a form", SWT.CHECK); td = new TableWrapData(); td.colspan = 2; button.setLayoutData(td); ImageHyperlink ih = toolkit.createImageHyperlink(form.getBody(), SWT.NULL); ih.setText("Image link with no image"); ih = toolkit.createImageHyperlink(form.getBody(), SWT.NULL); ih.setImage(JFaceResources.getImageRegistry().get(Dialog.DLG_IMG_MESSAGE_ERROR)); ih.setText("Link with image and text"); ExpandableComposite ec = toolkit.createExpandableComposite(form.getBody(), ExpandableComposite.TREE_NODE | ExpandableComposite.CLIENT_INDENT); ImageHyperlink eci = toolkit.createImageHyperlink(ec, SWT.NULL); eci.setImage(JFaceResources.getImageRegistry().get(Dialog.DLG_IMG_MESSAGE_ERROR)); ec.setTextClient(eci); ec.setText("Expandable Composite title"); String ctext = "We will now create a somewhat long text so that " + "we can use it as content for the expandable composite. " + "Expandable composite is used to hide or show the text using the " + "toggle control"; Label client = toolkit.createLabel(ec, ctext, SWT.WRAP); ec.setClient(client); td = new TableWrapData(); td.colspan = 2; ec.setLayoutData(td); ec.addExpansionListener(new ExpansionAdapter() { public void expansionStateChanged(ExpansionEvent e) { form.reflow(true); } }); Section section = toolkit.createSection(form.getBody(), Section.DESCRIPTION | Section.TWISTIE | Section.EXPANDED); td = new TableWrapData(TableWrapData.FILL); td.colspan = 2; section.setLayoutData(td); section.addExpansionListener(new ExpansionAdapter() { public void expansionStateChanged(ExpansionEvent e) { form.reflow(true); } }); section.setText("Section title"); toolkit.createCompositeSeparator(section); section.setDescription("This is the description that goes below the title"); Composite sectionClient = toolkit.createComposite(section); sectionClient.setLayout(new GridLayout()); button = toolkit.createButton(sectionClient, "Radio 1", SWT.RADIO); button = toolkit.createButton(sectionClient, "Radio 2", SWT.RADIO); section.setClient(sectionClient); StringBuffer buf = new StringBuffer(); buf.append("<form>"); buf.append("<p>"); buf.append("Here is some plain text for the text to render; "); buf.append( "this text is at <a href=\"http://www.eclipse.org\" nowrap=\"true\">http://www.eclipse.org</a> web site."); buf.append("</p>"); buf.append("<p>"); buf.append("<span color=\"header\" font=\"header\">This text is in header font and color.</span>"); buf.append("</p>"); buf.append("<p>This line will contain some <b>bold</b> and some <span font=\"code\">source</span> text. "); buf.append("We can also add <img href=\"image\"/> an image. "); buf.append("</p>"); buf.append("<li>A default (bulleted) list item.</li>"); buf.append("<li>Another bullet list item.</li>"); buf.append("<li style=\"text\" value=\"1.\">A list item with text.</li>"); buf.append("<li style=\"text\" value=\"2.\">Another list item with text</li>"); buf.append("<li style=\"image\" value=\"image\">List item with an image bullet</li>"); buf.append("<li style=\"text\" bindent=\"20\" indent=\"40\" value=\"3.\">A list item with text.</li>"); buf.append("<li style=\"text\" bindent=\"20\" indent=\"40\" value=\"4.\">A list item with text.</li>"); buf.append( "<p> leading blanks; more white \n\n new lines <br/><br/><br/> \n more <b> bb </b> white . </p>"); buf.append("</form>"); FormText rtext = toolkit.createFormText(form.getBody(), false); //rtext.setWhitespaceNormalized(false); td = new TableWrapData(TableWrapData.FILL); td.colspan = 2; rtext.setLayoutData(td); rtext.setImage("image", JFaceResources.getImageRegistry().get(Dialog.DLG_IMG_MESSAGE_ERROR)); rtext.setColor("header", toolkit.getColors().getColor(IFormColors.TITLE)); rtext.setFont("header", JFaceResources.getHeaderFont()); rtext.setFont("code", JFaceResources.getTextFont()); rtext.setText(buf.toString(), true, false); rtext.addHyperlinkListener(new HyperlinkAdapter() { public void linkActivated(HyperlinkEvent e) { System.out.println("Link active: " + e.getHref()); } }); /* layout.numColumns = 3; Label label; TableWrapData td; label = toolkit.createLabel(form.getBody(), "Some text to put in the first column", SWT.WRAP); label = toolkit.createLabel(form.getBody() ,"Some text to put in the second column and make it a bit longer so that we can see what happens with column distribution. This text must be the longest so that it can get more space allocated to the columns it belongs to.", SWT.WRAP); td = new TableWrapData(); td.colspan = 2; label.setLayoutData(td); label = toolkit.createLabel(form.getBody(), "This text will span two rows and should not grow the column.", SWT.WRAP); td = new TableWrapData(); td.rowspan = 2; label.setLayoutData(td); label = toolkit.createLabel(form.getBody(), "This text goes into column 2 and consumes only one cell", SWT.WRAP); label.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB)); label = toolkit.createLabel(form.getBody(), "This text goes into column 3 and consumes only one cell too", SWT.WRAP); label.setLayoutData(new TableWrapData(TableWrapData.FILL)); label = toolkit.createLabel(form.getBody(), "This text goes into column 2 and consumes only one cell", SWT.WRAP); label.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB)); label = toolkit.createLabel(form.getBody(), "This text goes into column 3 and consumes only one cell too", SWT.WRAP); label.setLayoutData(new TableWrapData(TableWrapData.FILL)); form.getBody().setBackground(form.getBody().getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));*/ toolkit.paintBordersFor(form.getBody()); }
From source file:org.eclipse.tcf.te.ui.views.editor.pages.AbstractEditorPage.java
License:Open Source License
/** * Get the image for the given message type. * @param messageType The message type.//from w w w. j a v a2 s . c o m * @return The image. */ protected Image getMessageImage(int messageType) { switch (messageType) { case IMessageProvider.INFORMATION: return JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_INFO); case IMessageProvider.WARNING: return JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_WARNING); case IMessageProvider.ERROR: return JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_ERROR); default: return null; } }
From source file:org.eclipse.ui.internal.views.markers.ViewerSettingsAndStatusDialog.java
License:Open Source License
/** */ protected Image getErrorImage() { return JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_ERROR); }