Bug 54347 [Dialogs] Provide "Yes No Always Never" dialog
In Debug UI, we define a dialog that prompts the user to answer Yes, No, Always, or Never. If anyone's interested, this code is generic and could be shipped as a JFace component. The dialog is in the org.eclipse.debug.ui project; the type name is AlwaysNeverDialog. The dialog supports passing in a preference store and preference key for the dialog to persist an Always or Never selection. For cases where clients don't have a preference store but still want to be able to get at the user's response, it alternatively supports passing in a string buffer where the dialog will store the "always/never/prompt" status.
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/dialogs/MessageDialogWithToggle.java
* 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.ui.internal.ide.dialogs;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.internal.ide.IDEWorkbenchMessages;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.preference.IPreferenceStore;
/**
 * A message dialog which also allows the user to adjust a toggle setting.
 * 
 * This is typically used to allow the user to indicate whether the dialog
 * should be shown in the future.
 */
public class MessageDialogWithToggle extends MessageDialog {
	
	/**
	 * The message displayed to the user, with the toggle button
	 */
	private String toggleMessage = null;