Example usage for org.eclipse.jface.dialogs IDialogConstants ABORT_LABEL

List of usage examples for org.eclipse.jface.dialogs IDialogConstants ABORT_LABEL

Introduction

In this page you can find the example usage for org.eclipse.jface.dialogs IDialogConstants ABORT_LABEL.

Prototype

String ABORT_LABEL

To view the source code for org.eclipse.jface.dialogs IDialogConstants ABORT_LABEL.

Click Source Link

Document

The label for abort buttons.

Usage

From source file:de.defmacro.dandelion.internal.ui.dialogs.EvalFailureDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    createButton(parent, IDialogConstants.ABORT_ID, IDialogConstants.ABORT_LABEL, true);
    if (!fRestarts.isEmpty()) {
        createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
        setOKButtonEnabled(false);// www  . j  av  a 2 s  .co m
        hintSelectRestart(true);
    }
}

From source file:org.eclipse.andmore.android.launch.ui.StartedInstancesDialog.java

License:Apache License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    // create OK, Ignore and Abort buttons
    okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    ignoreButton = createButton(parent, IDialogConstants.IGNORE_ID, IDialogConstants.IGNORE_LABEL, false);
    abortButton = createButton(parent, IDialogConstants.ABORT_ID, IDialogConstants.ABORT_LABEL, false);

    ignoreButton.addMouseListener(new MouseListener() {

        @Override/*from w w w.j av a 2  s  .c  o  m*/
        public void mouseUp(MouseEvent e) {
            setReturnCode(IDialogConstants.IGNORE_ID);
            close();
        }

        @Override
        public void mouseDown(MouseEvent e) {
            // do nothing
        }

        @Override
        public void mouseDoubleClick(MouseEvent e) {
            // do nothing
        }
    });

    abortButton.addMouseListener(new MouseListener() {

        @Override
        public void mouseUp(MouseEvent e) {
            setReturnCode(IDialogConstants.ABORT_ID);
            close();
        }

        @Override
        public void mouseDown(MouseEvent e) {
            // do nothing
        }

        @Override
        public void mouseDoubleClick(MouseEvent e) {
            // do nothing
        }
    });
}

From source file:org.eclipse.epf.authoring.ui.actions.UserInteractionHandler.java

License:Open Source License

/**
 * Return action text//from  ww  w .  ja  v a  2  s  .  c  o  m
 * 
 * @param action
 * @return Action text - either ABORT, CANCEL, OK, RETRY
 */
public static String getActionText(int action) {
    switch (action) {
    case IUserInteractionHandler.ACTION_ABORT:
        return IDialogConstants.ABORT_LABEL;
    case IUserInteractionHandler.ACTION_CANCEL:
        return IDialogConstants.CANCEL_LABEL;
    case IUserInteractionHandler.ACTION_OK:
        return IDialogConstants.OK_LABEL;
    case IUserInteractionHandler.ACTION_RETRY:
        return IDialogConstants.RETRY_LABEL;
    case IUserInteractionHandler.ACTION_YES:
        return IDialogConstants.YES_LABEL;
    case IUserInteractionHandler.ACTION_NO:
        return IDialogConstants.NO_LABEL;
    default:
        break;
    }
    return null;
}

From source file:org.eclipse.sirius.common.ui.tools.api.dialog.SiriusMessageDialogWithToggle.java

License:Open Source License

/**
 * Attempt to find a standard JFace button id that matches the specified
 * button label. If no match can be found, use the default id provided.
 * //from  w ww  .ja v  a  2 s  .c o  m
 * Overridden to investigate the provided buttons.
 * 
 * @param buttonLabel
 *            the button label whose id is sought
 * @param defaultId
 *            the id to use for the button if there is no standard id
 * @return the id for the specified button label
 */
// CHECKSTYLE:OFF
private int mapButtonLabelToButtonID(String buttonLabel, int defaultId) {
    // CHECKSTYLE:OON
    // Not pretty but does the job...
    if (IDialogConstants.OK_LABEL.equals(buttonLabel)) {
        return IDialogConstants.OK_ID;
    }

    if (IDialogConstants.YES_LABEL.equals(buttonLabel)) {
        return IDialogConstants.YES_ID;
    }

    if (IDialogConstants.NO_LABEL.equals(buttonLabel)) {
        return IDialogConstants.NO_ID;
    }

    if (IDialogConstants.CANCEL_LABEL.equals(buttonLabel)) {
        return IDialogConstants.CANCEL_ID;
    }

    if (IDialogConstants.YES_TO_ALL_LABEL.equals(buttonLabel)) {
        return IDialogConstants.YES_TO_ALL_ID;
    }

    if (IDialogConstants.SKIP_LABEL.equals(buttonLabel)) {
        return IDialogConstants.SKIP_ID;
    }

    if (IDialogConstants.STOP_LABEL.equals(buttonLabel)) {
        return IDialogConstants.STOP_ID;
    }

    if (IDialogConstants.ABORT_LABEL.equals(buttonLabel)) {
        return IDialogConstants.ABORT_ID;
    }

    if (IDialogConstants.RETRY_LABEL.equals(buttonLabel)) {
        return IDialogConstants.RETRY_ID;
    }

    if (IDialogConstants.IGNORE_LABEL.equals(buttonLabel)) {
        return IDialogConstants.IGNORE_ID;
    }

    if (IDialogConstants.PROCEED_LABEL.equals(buttonLabel)) {
        return IDialogConstants.PROCEED_ID;
    }

    if (IDialogConstants.OPEN_LABEL.equals(buttonLabel)) {
        return IDialogConstants.OPEN_ID;
    }

    if (IDialogConstants.CLOSE_LABEL.equals(buttonLabel)) {
        return IDialogConstants.CLOSE_ID;
    }

    if (IDialogConstants.BACK_LABEL.equals(buttonLabel)) {
        return IDialogConstants.BACK_ID;
    }

    if (IDialogConstants.NEXT_LABEL.equals(buttonLabel)) {
        return IDialogConstants.NEXT_ID;
    }

    if (IDialogConstants.FINISH_LABEL.equals(buttonLabel)) {
        return IDialogConstants.FINISH_ID;
    }

    if (IDialogConstants.HELP_LABEL.equals(buttonLabel)) {
        return IDialogConstants.HELP_ID;
    }

    if (IDialogConstants.NO_TO_ALL_LABEL.equals(buttonLabel)) {
        return IDialogConstants.NO_TO_ALL_ID;
    }

    if (IDialogConstants.SHOW_DETAILS_LABEL.equals(buttonLabel)) {
        return IDialogConstants.DETAILS_ID;
    }

    if (IDialogConstants.HIDE_DETAILS_LABEL.equals(buttonLabel)) {
        return IDialogConstants.DETAILS_ID;
    }

    for (String providedButton : buttonsMap.keySet()) {
        if (providedButton.equals(buttonLabel)) {
            return buttonsMap.get(providedButton);
        }
    }

    // No XXX_LABEL in IDialogConstants for these. Unlikely
    // they would be used in a message dialog though.
    // public int SELECT_ALL_ID = 18;
    // public int DESELECT_ALL_ID = 19;
    // public int SELECT_TYPES_ID = 20;

    return defaultId;
}