Example usage for org.eclipse.jface.dialogs Dialog getImage

List of usage examples for org.eclipse.jface.dialogs Dialog getImage

Introduction

In this page you can find the example usage for org.eclipse.jface.dialogs Dialog getImage.

Prototype

public static Image getImage(String key) 

Source Link

Document

Returns the standard dialog image with the given key.

Usage

From source file:org.eclipse.mylyn.internal.builds.ui.notifications.BuildsServiceNotification.java

License:Open Source License

@Override
public Image getNotificationImage() {
    return Dialog.getImage(notificationImage);
}

From source file:org.eclipse.mylyn.internal.builds.ui.notifications.BuildsServiceNotification.java

License:Open Source License

@Override
public Image getNotificationKindImage() {
    return Dialog.getImage(notificationKindImage);
}

From source file:org.eclipse.mylyn.internal.tasks.ui.dialogs.TaskRepositoryCredentialsDialog.java

License:Open Source License

private void createWarningMessage(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;/* ww  w . j a va 2s  . c  o m*/
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    composite.setLayout(layout);
    GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(2, 1).applyTo(composite);

    Label label = new Label(composite, SWT.NONE);
    label.setImage(Dialog.getImage(DLG_IMG_MESSAGE_WARNING));
    label.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_BEGINNING));

    label = new Label(composite, SWT.WRAP);
    label.setText(Messages.TaskRepositoryCredentialsDialog_Saved_passwords_are_stored_that_is_difficult);
    GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER)
            .hint(convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH), SWT.DEFAULT)
            .grab(true, false).applyTo(label);
}

From source file:org.eclipse.mylyn.internal.tasks.ui.notifications.TaskListServiceMessageControl.java

License:Open Source License

public void setMessage(ServiceMessage message) {
    if (message != null) {
        ensureControl();/*w  ww.j  av a 2 s. c  o m*/
        if (message.getETag() != null && message.getLastModified() != null) {
            IPreferenceStore preferenceStore = TasksUiPlugin.getDefault().getPreferenceStore();
            preferenceStore.setValue(ITasksUiPreferenceConstants.LAST_SERVICE_MESSAGE_ETAG, message.getETag());
            preferenceStore.setValue(ITasksUiPreferenceConstants.LAST_SERVICE_MESSAGE_LAST_MODIFIED,
                    message.getLastModified());
        }

        this.currentMessage = message;

        setTitle(message.getTitle());
        setTitleImage(Dialog.getImage(message.getImage()));
        setDescription(message.getDescription());
    }
}

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   w ww. j a v  a2s . c o 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.php.composer.ui.wizard.DetectGroup.java

License:Open Source License

public DetectGroup(Composite parent, LocationGroup locationGroup, NameGroup nameGroup) {
    this.fPHPLocationGroup = locationGroup;
    this.fGroupName = nameGroup;

    Composite composite = new Composite(parent, SWT.None);
    composite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true));
    GridLayout layout = new GridLayout(2, false);
    layout.horizontalSpacing = 10;//from  w w  w.ja  va  2  s .  co m
    composite.setLayout(layout);

    fIcon = new Label(composite, SWT.LEFT);
    fIcon.setImage(Dialog.getImage(Dialog.DLG_IMG_MESSAGE_WARNING));
    GridData gridData = new GridData(SWT.LEFT, SWT.CENTER, false, false);
    fIcon.setLayoutData(gridData);
    fIcon.setVisible(false);

    fHintText = new Link(composite, SWT.WRAP);
    fHintText.setFont(composite.getFont());
    gridData = new GridData(GridData.FILL, SWT.FILL, true, true);
    gridData.widthHint = 500;
    fHintText.setLayoutData(gridData);
    fHintText.setText(NewWizardMessages.ScriptProjectWizardFirstPage_DetectGroup_message);
    fHintText.setVisible(false);
}

From source file:org.eclipse.php.internal.debug.ui.actions.AddPHPExceptionBreakpointDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {
    readSettings();//from ww w  .  ja va  2 s . co m
    Composite area = (Composite) super.createDialogArea(parent);
    Label filterLabel = new Label(area, SWT.NONE);
    filterLabel.setText(Messages.AddPHPExceptionBreakpointDialog_Choose_an_exception_filter_message);
    fExceptionFilter = new Text(area, SWT.BORDER);
    GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
    fExceptionFilter.setLayoutData(gridData);
    fExceptionFilter.addModifyListener(new ModifyListener() {
        @Override
        public void modifyText(ModifyEvent e) {
            filterExceptionTypes(fExceptionFilter.getText());
        }
    });
    fExceptionFilter.addKeyListener(new KeyAdapter() {
        public void keyPressed(KeyEvent e) {
            if (e.keyCode == SWT.ARROW_DOWN) {
                fExceptionViewer.getTable().setFocus();
            }
        }
    });
    Label itemsLabel = new Label(area, SWT.NONE);
    itemsLabel.setText(Messages.AddPHPExceptionBreakpointDialog_Matching_items);
    fExceptionViewer = new TableViewer(area, SWT.BORDER | SWT.MULTI);
    gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
    PixelConverter converter = new PixelConverter(fExceptionViewer.getTable());
    gridData.widthHint = converter.convertWidthInCharsToPixels(60);
    gridData.heightHint = SWTUtil.getTableHeightHint(fExceptionViewer.getTable(), 10);
    fExceptionViewer.getTable().setLayoutData(gridData);
    fExceptionViewer.getTable().setFont(parent.getFont());
    fExceptionViewer.getTable().addMouseListener(new MouseAdapter() {
        @Override
        public void mouseDoubleClick(MouseEvent e) {
            okPressed();
        }
    });
    fExceptionViewer.setContentProvider(new ArrayContentProvider());
    fExceptionViewer.setLabelProvider(new LabelProvider());
    Collection<IType> input = fExceptionTypesCache;
    fExceptionViewer.setInput(fExceptionTypesCache);
    if (!input.isEmpty()) {
        fExceptionViewer.setSelection(new StructuredSelection(input.iterator().next()));
    }
    CLabel noteIcon = new CLabel(area, SWT.NONE);
    noteIcon.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1));
    noteIcon.setImage(Dialog.getImage(Dialog.DLG_IMG_MESSAGE_INFO));
    noteIcon.setText(Messages.AddPHPExceptionBreakpointDialog_Note);
    return area;
}

From source file:org.eclipse.wst.jsdt.internal.ui.dialogs.SortMembersMessageDialog.java

License:Open Source License

protected Control createMessageArea(Composite parent) {
    initializeDialogUnits(parent);// w ww . j av  a 2  s.  c  om

    Composite messageComposite = new Composite(parent, SWT.NONE);
    messageComposite.setFont(parent.getFont());
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    messageComposite.setLayout(layout);
    messageComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    createLinkControl(messageComposite);

    int indent = convertWidthInCharsToPixels(3);

    fNotSortAllRadio.doFillIntoGrid(messageComposite, 1);
    LayoutUtil.setHorizontalIndent(fNotSortAllRadio.getSelectionButton(null), indent);

    fSortAllRadio.doFillIntoGrid(messageComposite, 1);
    LayoutUtil.setHorizontalIndent(fSortAllRadio.getSelectionButton(null), indent);

    final Composite warningComposite = new Composite(messageComposite, SWT.NONE);
    layout = new GridLayout();
    layout.numColumns = 2;
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    warningComposite.setLayout(layout);
    warningComposite.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
    warningComposite.setFont(messageComposite.getFont());

    Image image = Dialog.getImage(Dialog.DLG_IMG_MESSAGE_WARNING);
    final Label imageLabel1 = new Label(warningComposite, SWT.LEFT | SWT.WRAP);
    imageLabel1.setImage(image);
    imageLabel1.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 1, 1));

    final Label label = new Label(warningComposite, SWT.WRAP);
    label.setText(DialogsMessages.SortMembersMessageDialog_sort_warning_label);
    GridData gridData = new GridData(GridData.FILL, GridData.CENTER, true, false, 1, 1);
    gridData.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
    label.setLayoutData(gridData);
    label.setFont(warningComposite.getFont());

    fNotSortAllRadio.setDialogFieldListener(new IDialogFieldListener() {
        public void dialogFieldChanged(DialogField field) {
            imageLabel1.setEnabled(!fNotSortAllRadio.isSelected());
            label.setEnabled(!fNotSortAllRadio.isSelected());
        }
    });
    imageLabel1.setEnabled(!fNotSortAllRadio.isSelected());
    label.setEnabled(!fNotSortAllRadio.isSelected());

    return messageComposite;
}

From source file:org.eclipse.wst.jsdt.internal.ui.refactoring.reorg.RenameTypeWizardSimilarElementsOptionsDialog.java

License:Open Source License

protected Control createMessageArea(Composite parent) {
    initializeDialogUnits(parent);//  w  w w. java 2s .  com

    Composite messageComposite = new Composite(parent, SWT.NONE);
    messageComposite.setFont(parent.getFont());
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    messageComposite.setLayout(layout);
    messageComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    Label infoLabel = new Label(messageComposite, SWT.WRAP);
    infoLabel.setText(RefactoringMessages.RenameTypeWizardSimilarElementsOptionsDialog_select_strategy);
    GridData gd = new GridData(GridData.FILL, GridData.CENTER, true, false);
    gd.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
    infoLabel.setLayoutData(gd);
    infoLabel.setFont(parent.getFont());

    int indent = convertWidthInCharsToPixels(3);

    fExactStrategyRadio = new SelectionButtonDialogField(SWT.RADIO);
    fExactStrategyRadio
            .setLabelText(RefactoringMessages.RenameTypeWizardSimilarElementsOptionsDialog_strategy_1);
    fExactStrategyRadio.doFillIntoGrid(messageComposite, 1);
    fExactStrategyRadio.setSelection(fSelectedStrategy == RenamingNameSuggestor.STRATEGY_EXACT);
    LayoutUtil.setHorizontalIndent(fExactStrategyRadio.getSelectionButton(null), indent);

    fEmbeddedStrategyRadio = new SelectionButtonDialogField(SWT.RADIO);
    fEmbeddedStrategyRadio
            .setLabelText(RefactoringMessages.RenameTypeWizardSimilarElementsOptionsDialog_strategy_2);
    fEmbeddedStrategyRadio.doFillIntoGrid(messageComposite, 1);
    fEmbeddedStrategyRadio.setSelection(fSelectedStrategy == RenamingNameSuggestor.STRATEGY_EMBEDDED);
    LayoutUtil.setHorizontalIndent(fEmbeddedStrategyRadio.getSelectionButton(null), indent);

    fSuffixStrategyRadio = new SelectionButtonDialogField(SWT.RADIO);
    fSuffixStrategyRadio
            .setLabelText(RefactoringMessages.RenameTypeWizardSimilarElementsOptionsDialog_strategy_3);
    fSuffixStrategyRadio.doFillIntoGrid(messageComposite, 1);
    fSuffixStrategyRadio.setSelection(fSelectedStrategy == RenamingNameSuggestor.STRATEGY_SUFFIX);
    LayoutUtil.setHorizontalIndent(fSuffixStrategyRadio.getSelectionButton(null), indent);

    final Composite warningComposite = new Composite(messageComposite, SWT.NONE);
    layout = new GridLayout();
    layout.numColumns = 2;
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    warningComposite.setLayout(layout);
    warningComposite.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
    warningComposite.setFont(messageComposite.getFont());

    Image image = Dialog.getImage(Dialog.DLG_IMG_MESSAGE_WARNING);
    fWarningImageLabel = new Label(warningComposite, SWT.LEFT | SWT.WRAP);
    fWarningImageLabel.setImage(image);
    fWarningImageLabel.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 1, 1));

    fWarningLabel = new Label(warningComposite, SWT.WRAP);
    fWarningLabel.setText(RefactoringMessages.RenameTypeWizardSimilarElementsOptionsDialog_warning_short_names);
    GridData gridData = new GridData(GridData.FILL, GridData.CENTER, true, false, 1, 1);
    gridData.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
    fWarningLabel.setLayoutData(gridData);
    fWarningLabel.setFont(warningComposite.getFont());

    fExactStrategyRadio.setDialogFieldListener(new IDialogFieldListener() {

        public void dialogFieldChanged(DialogField field) {
            updateLabel();
            fSelectedStrategy = RenamingNameSuggestor.STRATEGY_EXACT;
        }
    });

    fEmbeddedStrategyRadio.setDialogFieldListener(new IDialogFieldListener() {

        public void dialogFieldChanged(DialogField field) {
            updateLabel();
            fSelectedStrategy = RenamingNameSuggestor.STRATEGY_EMBEDDED;
        }
    });

    fSuffixStrategyRadio.setDialogFieldListener(new IDialogFieldListener() {

        public void dialogFieldChanged(DialogField field) {
            updateLabel();
            fSelectedStrategy = RenamingNameSuggestor.STRATEGY_SUFFIX;
        }
    });

    updateLabel();

    return messageComposite;
}

From source file:org.summer.sdt.internal.ui.dialogs.SortMembersMessageDialog.java

License:Open Source License

@Override
protected Control createMessageArea(Composite parent) {
    initializeDialogUnits(parent);//from  w w  w .  j a  va 2 s  .co m

    Composite messageComposite = new Composite(parent, SWT.NONE);
    messageComposite.setFont(parent.getFont());
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    messageComposite.setLayout(layout);
    messageComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    createLinkControl(messageComposite);

    fNotSortAllRadio.doFillIntoGrid(messageComposite, 1);
    LayoutUtil.setHorizontalIndent(fNotSortAllRadio.getSelectionButton(null));

    fSortAllRadio.doFillIntoGrid(messageComposite, 1);
    LayoutUtil.setHorizontalIndent(fSortAllRadio.getSelectionButton(null));

    final Composite warningComposite = new Composite(messageComposite, SWT.NONE);
    layout = new GridLayout();
    layout.numColumns = 2;
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    warningComposite.setLayout(layout);
    warningComposite.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
    warningComposite.setFont(messageComposite.getFont());

    Image image = Dialog.getImage(Dialog.DLG_IMG_MESSAGE_WARNING);
    final Label imageLabel1 = new Label(warningComposite, SWT.LEFT | SWT.WRAP);
    imageLabel1.setImage(image);
    imageLabel1.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 1, 1));

    final Label label = new Label(warningComposite, SWT.WRAP);
    label.setText(DialogsMessages.SortMembersMessageDialog_sort_warning_label);
    GridData gridData = new GridData(GridData.FILL, GridData.CENTER, true, false, 1, 1);
    gridData.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
    label.setLayoutData(gridData);
    label.setFont(warningComposite.getFont());

    fNotSortAllRadio.setDialogFieldListener(new IDialogFieldListener() {
        public void dialogFieldChanged(DialogField field) {
            imageLabel1.setEnabled(!fNotSortAllRadio.isSelected());
            label.setEnabled(!fNotSortAllRadio.isSelected());
        }
    });
    imageLabel1.setEnabled(!fNotSortAllRadio.isSelected());
    label.setEnabled(!fNotSortAllRadio.isSelected());

    return messageComposite;
}