Bug 273330 [JFace] Add API to MessageDialog to enable clients to use SWT.SHEET
A new style constant SWT.SHEET was added recently. Without adding new API in JFace, clients who are currently using the convenience methods MessageDialog.openWarning/Error/Information/Question/Confirmation would not be able to open these dialogs as sheets.
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/MessageDialogWithToggle.java
* @param toggleMessage
     *            the message for the toggle control, or <code>null</code> for
     *            the default message
     * @param toggleState
     *            the initial state for the toggle
     * @param store
     *            the IPreference store in which the user's preference should be
     *            persisted; <code>null</code> if you don't want it persisted
     *            automatically.
     * @param key
     *            the key to use when persisting the user's preference;
     *            <code>null</code> if you don't want it persisted.
     * @return the dialog, after being closed by the user, which the client can
     *         only call <code>getReturnCode()</code> or
     *         <code>getToggleState()</code>
     */
    public static MessageDialogWithToggle openError(Shell parent, String title,
            String message, String toggleMessage, boolean toggleState,
            IPreferenceStore store, String key) {
        MessageDialogWithToggle dialog = new MessageDialogWithToggle(parent,
                title, null, 
                message, ERROR, new String[] { IDialogConstants.OK_LABEL }, 0, 
                
                
                
                toggleMessage, toggleState);
        dialog.prefStore = store;
        dialog.prefKey = key;
        dialog.open();
        return dialog;