Bug 118934 - [Dialogs] Introduce dialog trays
Summary: [Dialogs] Introduce dialog trays
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: All All
: P2 enhancement (vote)
Target Milestone: 3.2 M5   Edit
Assignee: Curtis d'Entremont CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 119617
Blocks:
  Show dependency tree
 
Reported: 2005-12-01 17:11 EST by Curtis d'Entremont CLA
Modified: 2006-02-16 16:31 EST (History)
5 users (show)

See Also:


Attachments
patch (47.86 KB, patch)
2005-12-01 17:18 EST, Curtis d'Entremont CLA
no flags Details | Diff
screenshot with full height (34.06 KB, image/png)
2005-12-01 18:30 EST, Curtis d'Entremont CLA
no flags Details
screenshot with partial height (35.77 KB, image/png)
2005-12-01 18:34 EST, Curtis d'Entremont CLA
no flags Details
new patch (12.53 KB, patch)
2005-12-06 15:33 EST, Curtis d'Entremont CLA
no flags Details | Diff
new patch (part 2) (9.71 KB, patch)
2005-12-06 15:37 EST, Curtis d'Entremont CLA
no flags Details | Diff
patch for sash (4.70 KB, patch)
2005-12-20 15:05 EST, Curtis d'Entremont CLA
no flags Details | Diff
screenshot with sash (33.03 KB, image/png)
2005-12-20 15:07 EST, Curtis d'Entremont CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Curtis d'Entremont CLA 2005-12-01 17:11:32 EST
The requirement here is to be able to dynamically allocate a portion of a dialog to contain a tray. The tray can contain anything, but examples would include a toolbar/palette, context help, or cheat sheets.

The amount of work required to inherit this functionality should be minimal, and it should otherwise be transparent. Anyone (not just the dialog itself) should be able to show or hide a tray on the dialog at any time the dialog is shown.
Comment 1 Curtis d'Entremont CLA 2005-12-01 17:17:50 EST
Here is the proposed implementation. It involves creating a new TrayDialog class that subclasses Dialog. For those dialogs that previously subclassed Dialog directly and it makes sense to have trays, they will instead subclass TrayDialog. The TrayDialog has methods to open, close, and query whether the tray is open. Some additional notes:

- Using computeSize to get size of the tray, as opposed to API for declaring size.
- Migrated most popular dialogs that used to subclass Dialog to subclass TrayDialog instead 
- Added a separator for looks 
- Added a placeholder close button to the help tray's toolbar just to play with (I know I know... it's just a placeholder! :-)) 
- No option to select side to open - if LTR then it opens on the right, if RTL it's on the left. 

Todo: 

- Explore whether we can have a different look for the TitleAreaDialog (e.g. wizards) where the tray resides only in the client area, i.e. it doesn't take up the full height of the dialog.
- Should it be up to the tray provider to add a separator, or should there always be one (i.e. TrayDialog always adds it) ? Current feeling is that for now  the tray provider can provide the separator.
- Attempt a simple animation to slide in/out the tray.

the patch (to be posted) is on: 

org.eclipse.jface 
org.eclipse.help.ui 
org.eclipse.search 
org.eclipse.ui.ide 
org.eclipse.ui.workbench 
org.eclipse.update.ui 
Comment 2 Curtis d'Entremont CLA 2005-12-01 17:18:02 EST
Created attachment 30981 [details]
patch
Comment 3 Curtis d'Entremont CLA 2005-12-01 18:30:11 EST
Created attachment 30982 [details]
screenshot with full height

Here's a picture of a TitleAreaDialog where the tray takes the full height of the dialog.
Comment 4 Curtis d'Entremont CLA 2005-12-01 18:34:55 EST
Created attachment 30983 [details]
screenshot with partial height

And now a screenshot where the tray only takes up part of the TitleAreaDialog's height.

Which one do we like best? I prefer this one slightly over using the full height, in terms of how it looks.
Comment 5 Tod Creasey CLA 2005-12-02 08:27:42 EST
I definately like the second one better. Don't forget that the image on the TitleAreaDialog is a significant part of branding for a lot of plug-in developers.

As far as whether or not to have it I would think we should have a consistent default. We use sashes everywhere else so I think this would be fine.

And finally animations. I think it is worth looking into - if it sucks on some platforms we can always turn it off until we get a better solution. This is something we have only dabbled in before - having a good technique figured out by someone would be a good feature.
Comment 6 Dejan Glozic CLA 2005-12-02 10:25:37 EST
Curtis, take a look at the new code in org.eclipse.ui.forms.widgets.Form. I added message area slide in/slide out animation - you can borrow some ideas (and I borrowed the ideas from RectangleAnimation, so there :-).
Comment 7 Dejan Glozic CLA 2005-12-02 10:30:13 EST
Unfortunately I don't share Tod's preference. Although it looks better visually, it implies that the tray is part of the wizard contents. Consequently, the buttons are all the way to the right, implying that you are 'Finishing' the content of the help view. The first picture is more consistent in that it implies that header, buttons and wizard contents are one cohesive whole, while the tray contents is an 'add-on' - an auxilliary information that is related to that whole but is not part of it.

We should ask the community and the usability experts for more feedback on this one.
Comment 8 Curtis d'Entremont CLA 2005-12-02 10:49:31 EST
Any thoughs Joe? (see the two screenshot attachments)
Comment 9 Curtis d'Entremont CLA 2005-12-02 10:50:25 EST
Thoughts Julian? (see screenshot attachments)
Comment 10 Curtis d'Entremont CLA 2005-12-06 15:33:48 EST
Created attachment 31246 [details]
new patch

New patch on org.eclipse.jface. I have tested on windows, mac, gtk, and with RTL. As for the TitleAreaDialog, it uses the full height for now, we can tweak later if needed. There is no animation yet, I plan to look at this over the holidays.

Tod, can you review and if there are no problems, check it in for the next integration build for M4?
Comment 11 Curtis d'Entremont CLA 2005-12-06 15:37:54 EST
Created attachment 31247 [details]
new patch (part 2)

And here is a patch on org.eclipse.ui.ide and org.eclipse.ui.workbench to make the  appropriate dialogs extend TrayDialog instead of just Dialog, so they can have a tray. I will chase down the dialogs from other components separately to subclass TrayDialog once it's in CVS.

Let me know if there are any problems.
Thanks
Comment 12 Tod Creasey CLA 2005-12-06 16:35:56 EST
Patch released to HEAD for build >20051206
Comment 13 Curtis d'Entremont CLA 2005-12-20 15:05:06 EST
Created attachment 32036 [details]
patch for sash

And finally, here is the patch for adding a sash to be able to resize the tray. So where there used to be a single Label separator, there is now a Sash enclosed between two Label separators. I would have done this with a single separator and a white Sash to make it less pronounced, but we cannot make any assumptions about the background color inside the tray. In a way I like this look better because it more clearly separates the tray from the rest of the dialog, hinting that it is a different from the rest of the dialog contents.

The sash is currently enabled for all trays. If, down the road, people want the ability to customize this, we can add the API.

I will attach a screenshot.
Comment 14 Curtis d'Entremont CLA 2005-12-20 15:07:20 EST
Created attachment 32037 [details]
screenshot with sash
Comment 15 Tod Creasey CLA 2006-01-09 16:17:54 EST
https://bugs.eclipse.org/bugs/attachment.cgi?id=31247&action=view is currently out of date and needs to be refreshed
Comment 16 Tod Creasey CLA 2006-01-09 16:30:34 EST
I have released the patch for the TrayDialog changes for build >20060109
Comment 17 Curtis d'Entremont CLA 2006-01-09 17:39:19 EST
(In reply to comment #15)
> https://bugs.eclipse.org/bugs/attachment.cgi?id=31247&action=view is currently
> out of date and needs to be refreshed
> 

This one has already been applied to HEAD (2005-12-06). If there is nothing more, I consider this feature complete.
Comment 18 Tod Creasey CLA 2006-02-16 16:31:00 EST
Verified in 20060216-0100