Bug 65095 MessageDialogWithToggle returns wrong value for yes_to_all
I'm using MessageDialogWithToggle class with 4 buttons: MessageDialogWithToggle dialog = new MessageDialogWithToggle( Display.getCurrent().getActiveShell(), RSCCoreUIPlugin.getString("ConfirmDeleteDialog.title_UI_"), null, message, MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.YES_TO_ALL_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL}, 1, SUBuilderPlugin.getString("CONFIRM_DELETE_DESC"), checkbox ); The following values 2, 1, 3, 1 are being returned for YES, YES_TO_ALL, NO, CANCEL buttons respectively. The YES_TO_ALL value is wrong, according to IDialogConstants it should be YES_TO_ALL_ID = 4.
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/MessageDialogWithToggle.java
* A mutator for the button providing the toggle option. If the button
     * exists, then it will automatically get the text set to the current toggle
     * message, and its selection state set to the current selection state.
     * 
     * @param button
     *            The button to use; must not be <code>null</code>.
     */
    protected void setToggleButton(Button button) {
        if (button == null) { throw new NullPointerException(
                "A message dialog with toggle may not have a null toggle button."); } 
        if (!button.isDisposed()) {
            final String text;
            if (toggleMessage == null) {
                text = JFaceResources
                        .getString("MessageDialogWithToggle.defaultToggleMessage"); 
            } else {
                text = toggleMessage;
            }
            button.setText(text);
            button.setSelection(toggleState);
        }
        this.toggleButton = button;
    }
    /**
     * A mutator for the text on the toggle button. The button will
     * automatically get updated with the new text, if it exists.
     * 
     * @param message
     *            The new text of the toggle button; if it is <code>null</code>,
     *            then used the default toggle message.