Bug 54347 - [Dialogs] Provide "Yes No Always Never" dialog
Summary: [Dialogs] Provide "Yes No Always Never" dialog
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC All
: P4 enhancement (vote)
Target Milestone: 3.0 M9   Edit
Assignee: Douglas Pollock CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
: 39393 (view as bug list)
Depends on:
Blocks: 57272
  Show dependency tree
 
Reported: 2004-03-10 13:07 EST by Jared Burns CLA
Modified: 2004-06-28 15:41 EDT (History)
6 users (show)

See Also:


Attachments
Preferences Dialog for a Yes/No/Prompt Option (bitmap) (648.54 KB, application/octet-stream)
2004-04-08 09:39 EDT, Douglas Pollock CLA
no flags Details
new dialog (14.48 KB, patch)
2004-04-26 15:35 EDT, Kevin Barnes CLA
no flags Details | Diff
New patch. (15.36 KB, patch)
2004-04-28 14:13 EDT, Kevin Barnes CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jared Burns CLA 2004-03-10 13:07:52 EST
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.
Comment 1 Tod Creasey CLA 2004-03-29 10:55:37 EST
No plan for 3.0 but a suggested implementation might be sometime that would 
help.
Comment 2 Jared Burns CLA 2004-03-29 11:26:09 EST
Not sure I understand your last comment. We have a complete implementation that 
you can take.
Comment 3 Tod Creasey CLA 2004-04-06 16:48:33 EDT
Reopening for Doug
Comment 4 Douglas Pollock CLA 2004-04-06 17:34:50 EDT
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. 
Comment 5 Jared Burns CLA 2004-04-06 19:18:05 EDT
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.debug.
ui/ui/org/eclipse/debug/internal/ui/AlwaysNeverDialog.java
Comment 6 Jared Burns CLA 2004-04-06 19:24:27 EDT
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?).
Comment 7 Douglas Pollock CLA 2004-04-08 09:38:09 EDT
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. 
Comment 8 Douglas Pollock CLA 2004-04-08 09:39:36 EDT
Created attachment 9329 [details]
Preferences Dialog for a Yes/No/Prompt Option (bitmap)
Comment 9 Kevin Barnes CLA 2004-04-26 15:35:49 EDT
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.
Comment 10 Kevin Barnes CLA 2004-04-28 13:00:47 EDT
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.
Comment 11 Kevin Barnes CLA 2004-04-28 13:02:51 EDT
oops, MessageDialog is already API. Solves that problem :-)
Comment 12 Kevin Barnes CLA 2004-04-28 14:13:48 EDT
Created attachment 10070 [details]
New patch.

fixed a bug that resulted in button ids not being set properly
Comment 13 Douglas Pollock CLA 2004-04-29 16:44:32 EDT
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. 
Comment 14 Douglas Pollock CLA 2004-05-19 17:02:17 EDT
Dialog is provided as API.  Nothing to really verify here....
Comment 15 Douglas Pollock CLA 2004-06-28 15:41:55 EDT
*** Bug 39393 has been marked as a duplicate of this bug. ***