Example usage for org.eclipse.jface.dialogs MessageDialog WARNING

List of usage examples for org.eclipse.jface.dialogs MessageDialog WARNING

Introduction

In this page you can find the example usage for org.eclipse.jface.dialogs MessageDialog WARNING.

Prototype

int WARNING

To view the source code for org.eclipse.jface.dialogs MessageDialog WARNING.

Click Source Link

Document

Constant for the warning image, or a simple dialog with the warning image and a single OK button (value 4).

Usage

From source file:uk.ac.stfc.isis.ibex.ui.configserver.editing.components.ComponentEditorPanel.java

License:Open Source License

/**
 * Sets the configuration to edit.//  ww  w.j a  v  a 2s  .  co m
 * 
 * @param config The configuration
 */
public void setConfig(final EditableConfiguration config) {

    components = config.getEditableComponents();
    IObservableList selected = BeanProperties.list("selected").observe(components);
    IObservableList unselected = BeanProperties.list("unselected").observe(components);
    editor.bind(unselected, selected);

    final DuplicateChecker duplicateChecker = new DuplicateChecker();

    editor.addSelectionListenerForSelecting(new SelectionAdapter() {
        @SuppressWarnings("unchecked")
        @Override
        public void widgetSelected(SelectionEvent e) {
            duplicateChecker.setBase(config.asConfiguration());
            Collection<Configuration> toToggle = editor.unselectedItems();
            Map<String, Set<String>> allConflicts = duplicateChecker.checkOnAdd(toToggle);

            Iterator<Configuration> iter = toToggle.iterator();
            while (iter.hasNext()) {
                Configuration comp = iter.next();
                if (allConflicts.keySet().contains(comp.getName())) {
                    iter.remove();
                }
            }

            if (allConflicts.isEmpty()) {
                components.toggleSelection(toToggle);
            } else {
                new MessageDialog(getShell(), "Conflicts with current configuration", null,
                        buildWarning(allConflicts), MessageDialog.WARNING, new String[] { "Ok" }, 0).open();
            }
        }
    });

    editor.addSelectionListenerForUnselecting(new SelectionAdapter() {
        @SuppressWarnings("unchecked")
        @Override
        public void widgetSelected(SelectionEvent e) {
            components.toggleSelection(editor.selectedItems());
        }
    });
}

From source file:us.pwc.vista.eclipse.core.helper.MessageDialogHelper.java

License:Apache License

public static void showWarning(String title, String message) {
    Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
    MessageDialog.open(MessageDialog.WARNING, shell, title, message, SWT.NONE);
}

From source file:us.pwc.vista.eclipse.core.helper.MessageDialogHelper.java

License:Apache License

private static int getDialogSeverity(int severity) {
    switch (severity) {
    case IStatus.ERROR:
        return MessageDialog.ERROR;
    case IStatus.WARNING:
        return MessageDialog.WARNING;
    case IStatus.INFO:
        return MessageDialog.INFORMATION;
    default://  w ww  .j  a  v  a  2s.  c o m
        return MessageDialog.NONE;
    }
}