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:gov.redhawk.frontend.ui.internal.DeallocateHandler.java

License:Open Source License

private int confirmDeallocate(TunerStatus tuner, ExecutionEvent event) {
    MessageDialog warning = new MessageDialog(HandlerUtil.getActiveWorkbenchWindow(event).getShell(),
            "Deallocation Warning", null,
            "Some selected tuners have listeners.  Deallocating them will also deallocate all of their listeners.  Deallocate them anyway?",
            MessageDialog.WARNING, new String[] { "Cancel", "Yes" }, 0);
    return warning.open();
}

From source file:gov.redhawk.ide.codegen.ui.internal.command.GenerateCodeHandler.java

License:Open Source License

private boolean shouldUpgrade(Shell parent, String name) throws CoreException {
    String message = name + " uses deprecated code generators.\n\n" + "Would you like to upgrade this project?";
    MessageDialog dialog = new MessageDialog(parent, "Deprecated Generator", null, message,
            MessageDialog.WARNING, new String[] { "Upgrade", "Cancel" }, 1);
    switch (dialog.open()) {
    case 0: // Upgrade
        return true;
    case 1:// Cancel
    default://from ww w  .j a v a 2s. c o  m
        throw new OperationCanceledException();
    }
}

From source file:gov.redhawk.ide.codegen.ui.internal.GenerateFilesDialog.java

License:Open Source License

protected boolean checkUserFile(boolean newValue, FileStatus element) {
    if (!askedUserFile) {
        if (newValue && !element.getDoItDefault()) {
            MessageDialog dialog = new MessageDialog(getShell(), "WARNING", null,
                    "The file '" + element.getFilename() + "' is a 'USER' file.\n"
                            + "This file may contain code that was written by the user.  "
                            + "\n\nCONTINUING WILL OVERWRITE THIS CODE.\n\n"
                            + "Are you sure you want to do this?",
                    MessageDialog.WARNING, new String[] { "Yes", "No" }, 1);
            if (dialog.open() == 0) {
                askedUserFile = true;// w w  w.j a  va 2s  .c  om
                return true;
            } else {
                return false;
            }
        }
        return true;
    } else {
        return true;
    }
}

From source file:Gui.MainWindow_ver2.java

License:Open Source License

private void saveBeforExitMessage() {
    if (!isMulti) {
        String title = ("Save before exit");
        String message = ("The current game was not saved. Would you like to save it?");
        String[] options = new String[2];
        options[0] = "YES";
        options[1] = "NO";
        MessageDialog messageBox = new MessageDialog(shell, title, null, message, MessageDialog.WARNING,
                options, 2);/*from ww w.j a va  2  s .c  o  m*/
        int response = messageBox.open();
        if (response == 0) {
            saveAction();
        }
    }
}

From source file:info.vancauwenberge.designer.enhtrace.editor.input.StaticTraceEditorInput.java

License:Mozilla Public License

/**
 * Rescan the list of logmessages to set the root to the latest message with the same 'signature' as the current root.
 *///from  w  w w . j a  va  2 s . co  m
public void rescan() {
    //Create the path
    System.out.println("StaticTraceEditorInput.rescan(): start");
    List<ILogMessage> path = new ArrayList<ILogMessage>();
    ILogMessage pathItem = detailRoot;
    while (pathItem != null) {
        path.add(pathItem);
        pathItem = pathItem.getParent();
    }
    System.out.println("StaticTraceEditorInput.rescan(): Current path:" + path);

    //The last item in the pathList is the root. Get the latest root from the list corresponding to this
    ILogMessageList messageList = getActiveList();
    if (messageList == null) {
        MessageDialog.open(MessageDialog.WARNING, null, "No active live trace",
                "No live trace editor could be found", SWT.NONE);
        return;
    }

    ILogMessage[] events = messageList.getMessages();

    //Start with the last message
    if (events.length > 0) {
        int index = events.length - 1;
        while (index >= 0) {
            ILogMessage previous = events[index];
            index--;
            if (previous.getParent() == null) {
                if (haveSameSignature(path, path.size() - 1, previous)) {
                    System.out.println("StaticTraceEditorInput.rescan(): found   :" + previous);
                    System.out.println("StaticTraceEditorInput.rescan(): previous:" + detailRoot);
                    if (detailRoot == previous) {
                        System.out.println("StaticTraceEditorInput.rescan(): Last found is equal to current");
                        break;
                    }
                    System.out.println("StaticTraceEditorInput.rescan(): notifying listeners.");
                    ILogMessage oldValue = detailRoot;
                    detailRoot = previous;
                    for (IStaticInputListener aListener : listeners) {
                        aListener.notifyRootChanged(detailRoot, oldValue);
                    }
                    break;
                }
            }
        }
    }
    System.out.println("StaticTraceEditorInput.rescan(): end");
}

From source file:melnorme.util.swt.SWTUtil.java

License:Open Source License

public static int statusLevelToMessageDialogKing(StatusLevel statusLevel) {
    switch (statusLevel) {
    case ERROR:/*from ww w .  j  a  va 2 s.  c  o  m*/
        return MessageDialog.ERROR;
    case WARNING:
        return MessageDialog.WARNING;
    case INFO:
        return MessageDialog.INFORMATION;
    case OK:
        return MessageDialog.OK;
    }
    throw assertFail();
}

From source file:net.refractions.udig.ui.ZoomingDialog.java

License:Open Source License

public static void openWarningMessage(Rectangle start, Shell parentShell, String dialogTitle,
        String dialogMessage) {/*  w  w w.ja va 2  s. com*/
    openMessageDialog(start, parentShell, dialogTitle, null, dialogMessage, MessageDialog.WARNING,
            new String[] { IDialogConstants.OK_LABEL }, 1);
}

From source file:net.rim.ejde.internal.launching.MDSCSChecker.java

License:Open Source License

private static void askUserDecision(final String title, final String message) {
    Display.getDefault().syncExec(new Runnable() {
        public void run() {
            Shell shell = new Shell();
            MessageDialog dialog = new MessageDialog(shell, title, null, // accept the default window icon
                    message, MessageDialog.WARNING,
                    new String[] { IDialogConstants.PROCEED_LABEL, IDialogConstants.STOP_LABEL }, 0); // proceed
            // is the default
            _userDecision = dialog.open();
            shell.dispose();// ww  w.  j a  v  a 2  s  .  co m
        }
    });
}

From source file:net.rim.ejde.internal.signing.ImportCSIFilesAction.java

License:Open Source License

/**
 * Displays a warning dialog indicating that the signature tool is already running.
 *///  w w  w .j a va 2s .c  o  m
private void warnSignatureToolRunning() {
    MessageDialog dialog = new MessageDialog(ContextManager.getActiveWorkbenchShell(),
            "Signature Tool is already running...", null,
            "The Signature Tool is already running.  Please exit the tool before running it again.",
            MessageDialog.WARNING, new String[] { "OK" }, 0);
    dialog.open();
}

From source file:net.rim.ejde.internal.signing.ImportSignKeysAction.java

License:Open Source License

@Override
public void run(IAction action) {
    // Open file dialog to allow user select the parent folder of *.csk and *.db files
    SigningSearchDialog oldKeyDialog = new SigningSearchDialog(ContextManager.getActiveWorkbenchShell());
    try {/*from  ww w  .j  ava  2  s.  c o  m*/
        ArrayList<File> oldKeyFiles = oldKeyDialog.search();
        if (oldKeyFiles != null) {
            oldKeyDialog.copyFileIntoSignToolDir(oldKeyFiles);
            MessageDialog dialog = new MessageDialog(ContextManager.getActiveWorkbenchShell(),
                    Messages.CodeSigningPrefsPage_MessageDialogTitle1, null,
                    Messages.CodeSigningPrefsPage_MessageDialogMsg1, MessageDialog.INFORMATION,
                    new String[] { IDialogConstants.OK_LABEL }, 0);
            dialog.open();
            _log.info(Messages.CodeSigningPrefsPage_MessageDialogMsg9);
        }
    } catch (IllegalArgumentException ex) {
        MessageDialog dialog = new MessageDialog(ContextManager.getActiveWorkbenchShell(),
                Messages.CodeSigningPrefsPage_MessageDialogTitle1, null, ex.getMessage(), MessageDialog.WARNING,
                new String[] { IDialogConstants.OK_LABEL }, 0);
        dialog.open();
    }
}