Community
Participate
Working Groups
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.
No plan for 3.0 but a suggested implementation might be sometime that would help.
Not sure I understand your last comment. We have a complete implementation that you can take.
Reopening for Doug
Jared: do you have a complete implementation you could pass to us? I've made recent comments on eclipse-dev about changes I'd like to make to this paradigm. If you're willing, I can take your code, implement my changes, and make it available in jface.
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.debug. ui/ui/org/eclipse/debug/internal/ui/AlwaysNeverDialog.java
Adding "...DialogWithToggle" support all over the place would be great. In debugland, I've already implemented one for error messages (org.eclipse.jdt.internal.debug.ui.ErrorDialogWithToggle) and there are a ton of "MessageDialogWithToggle"s floating around (presumably copies of the one Platform UI has but doesn't expose as API?).
From Nick: I just got one of the those "don't bug me again" dialogs in MS Outlook, asking whether it should send a read receipt. It had "Yes" and "No" buttons and a "Don't ask me again" checkbox. I don't think it had a close box. The same setting can be configured in the prefs. See the bottom group below. The "Never" choice was made after choosing "No" + "Don't ask me again" in the prompt.
Created attachment 9329 [details] Preferences Dialog for a Yes/No/Prompt Option (bitmap)
Created attachment 9975 [details] new dialog Created a "new" Dialog in org.eclipse.internal.ide.dialogs with intention of eventually moving to API. Code is borrowed heavily from MessageDialogWithToggle, but I added a couple convenience methods and added support for passing in an IPreferenceStore and a Key. The dialog will attempt to set the preference if the check box is selected and the user selected an appropriate button (ie did not press 'Cancel') Doug, have a look at the patch. If you see any improvements you'd like made let me know.
Just realized that the patch I sent extends MessageDialog so both would have to be made API. Also the patch contains a bug and sometimes doesn't set preferences properly. I'll submit a new patch to address both issues.
oops, MessageDialog is already API. Solves that problem :-)
Created attachment 10070 [details] New patch. fixed a bug that resulted in button ids not being set properly
I've committed this patch to CVS with one noteworthy change, and a bunch of unremarkable changes. The noteworthy change is that it has been moved to jface. The rest of the changes are cosmetic (i.e., javadoc, formatting, etc.). I'd strongly appreciate feedback on this new API (sooner rather than later). Though I don't anticipate changes, I would also ask that all people adopting this API be a bit forgiving of if changes have to made.
Dialog is provided as API. Nothing to really verify here....
*** Bug 39393 has been marked as a duplicate of this bug. ***