Bug 69732 - [CheatSheets] Cheat Sheets do not work with modal dialogs
Summary: [CheatSheets] Cheat Sheets do not work with modal dialogs
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: User Assistance (show other bugs)
Version: 3.0   Edit
Hardware: PC All
: P1 normal (vote)
Target Milestone: 3.2 M5   Edit
Assignee: Curtis d'Entremont CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-09 11:46 EDT by Michael Scharf CLA
Modified: 2005-12-26 19:43 EST (History)
5 users (show)

See Also:


Attachments
screenshot (35.39 KB, image/png)
2005-11-23 13:57 EST, Curtis d'Entremont CLA
no flags Details
patch (63.39 KB, patch)
2005-12-09 15:21 EST, Curtis d'Entremont CLA
no flags Details | Diff
updated patch (63.37 KB, patch)
2005-12-09 15:40 EST, Curtis d'Entremont CLA
no flags Details | Diff
screenshot of a cheat sheet in the tray (37.38 KB, image/x-png)
2005-12-09 17:20 EST, Curtis d'Entremont CLA
no flags Details
screenshot with context help in the tray (36.30 KB, image/x-png)
2005-12-09 17:20 EST, Curtis d'Entremont CLA
no flags Details
rollback patch for this one and 120285 (69.00 KB, patch)
2005-12-13 14:40 EST, Curtis d'Entremont CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Scharf CLA 2004-07-09 11:46:08 EDT
If the user opens a model dialog (like a wizard or a property page) while 
following the instructions of a CheatSheet, access to the CheatSheet is 
blocked. This makes CheatSheets less useful, because often the part the user 
needs help with is in some modal dialogs.

One solution could be, to make cheat sheets to run in an external executable 
(that would be a nice example of a RCP application), so the cheat sheet is 
accessible in the modal context....
Comment 1 Dejan Glozic CLA 2005-06-07 10:50:20 EDT
This is known limitation for which we currently have no solution.
Comment 2 Michael Scharf CLA 2005-06-09 12:04:54 EDT
Well, in eclipse 3.1 it is now possible to have a Help Dialog next to
a modal dialog (e.g. go to the preferences and hit F1).

The same mechanism could be used to create a cheat sheet dialog that
lives in parallel to the modal dialog. This would require that there could
be multiple views showing the same cheat sheet "model"....
Comment 3 Dejan Glozic CLA 2005-06-09 12:10:03 EDT
Yes, we already considered that idea and will certanly continue down that path 
post 3.1. But the extent of the change is far larger from we would be 
comfortable with in the final stages of 3.1 release.
Comment 4 Michael Scharf CLA 2005-07-27 20:18:00 EDT
Any chance to work on this for 3.1?
Comment 5 Curtis d'Entremont CLA 2005-11-23 13:48:30 EST
Just to update everyone, here's the status on this one.

The way we're proposing to fix this problem is to have the cheat sheet follow the user as they open modal dialogs, such once the dialog is opened, the cheat sheet will automatically appear next to it and you'll be able to use it while using the modal dialog.

The original idea was to show a lightweight view that would look like a child of the dialog, and it would be in a sense "docked" with the dialog. This would be used by both cheat sheets and context help, so that you could have these two things in the docked window at the same time. For cheat sheets, the cheat sheet would start off as a view, and when a modal dialog appears the view would be hidden and a docked cheat sheet would appear in its place. Once the docked cheats sheet is dismissed, or the dialog is closed, it goes back to being a view. Since users are already familiar with the tabs in the view presentation, we decided to reuse this look. This is currently working in windows and mac, but there are issues in GTK preventing us from going further, these are:

1) GTK has different concepts when it comes to modality, and as a result, with the current SWT implementation if you ask it to open a modeless dialog from a modal dialog, it will actually be modal, so you can only use one window at a time.
2) Tracking problem - GTK does not reliably send events when windows move, and so we can't have the docked window follow the parent shell reliably.

See screenshot to see what this currently looks like on windows.

The UI team has proposed an alternative which avoids both problems. The proposal is to introduce the notion of a "docked portion" of a window into jface, so that  you can grow the window a little to make room for some new UI that's going to appear on the side. Here it's going to be in the same window, not a separate window, so there is no modality issue and no tracking issue here. I am currently prototyping this to determine its feasibility, and will keep you up to date on my progress.
Comment 6 Curtis d'Entremont CLA 2005-11-23 13:57:02 EST
Created attachment 30499 [details]
screenshot
Comment 7 Tobias Schwarz CLA 2005-11-24 10:41:54 EST
if the implementation of the cheet sheets for dialog is the same or equals that of the help for dialogs, please look also on bugzilla 
https://bugs.eclipse.org/bugs/show_bug.cgi?id=116197

on this dialog cheet sheets the same prolems would happen when a dialog is very small!

Comment 8 Curtis d'Entremont CLA 2005-12-09 15:21:07 EST
Created attachment 31492 [details]
patch

Mazen, here's the patch for this one. Can you apply to HEAD?

Note: There are two outstanding issues with this one, one is a bug in SWT that is causing the tray close button hot image to be always displayed on the mac. See bug  119915. The other is a problem syncing up cheat sheet progress; if you skip or complete some steps while in a modal dialog, then exit, the original cheat sheet viewer doesn't know about the changes. This one will be resolved shortly.
Comment 9 Curtis d'Entremont CLA 2005-12-09 15:40:22 EST
Created attachment 31495 [details]
updated patch

Actually the syncing wasn't as bad as I anticipated - here is the updated (complete) patch with this problem resolved.
Comment 10 Curtis d'Entremont CLA 2005-12-09 17:19:11 EST
Patch checked into HEAD by Mazen.

The fix involved adding the notion of trays into jface dialogs (see bug 118934), as the UI team suggested (thanks), and using the tray to host the cheat sheet inside dialogs. As part of this bug I also migrated the context help window content into the tray as well, and they can coexist in the same tray if needed - the user navigates between them using the back/forward buttons.

In order to make this happen you need to ensure two things:

1. The dialog you want to jump into supports trays. For most dialogs, like wizards, preferences, properties, launch config, any dialog with a title area, this will work automatically. Only those custom dialogs that subclass the Dialog class directly need to be changed; instead they should subclass TrayDialog. That's it.

2. The cheat sheet author must flag each step that involves opening a modal dialog. For these items, there is a new attribute "dialog", that you can set to true or false. The default is false. dialog="true" means this item or one of its subitems involves opening a dialog, and it is a hint to the system that it should allow the user to continue using the cheat sheet while that dialog is open. While the user is in a step that is flagged as such, any dialog opened that supports trays will automatically receive the cheatsheet in its tray.

Here is an example:

<item
      href="/org.eclipse.jdt.doc.user/tasks/tasks-12.htm"
      title="Create a Java project"
      dialog="true"
      skip="true">
   <action
         pluginId="org.eclipse.jdt.ui"
         class="org.eclipse.jdt.ui.actions.OpenNewJavaProjectWizardAction"/>
   <description>
      The first thing you will need is a Java Project. If you
      already have a Java project in your workspace that you
      would like to use, you may skip this step by clicking the
      "Click to Skip" button. If not, select File-&gt;New-&gt;Project...
      and choose Java Project in the list. Complete the subsequent
      pages as required. The "New Java Project" wizard is automatically
      displayed when you click the "Click to Perform" button.
   </description>
</item>

One additional note: Due to bug 119617, trays currently don't appear in some dialogs such as wizards, however this will be fixed very soon.
Comment 11 Curtis d'Entremont CLA 2005-12-09 17:20:05 EST
Created attachment 31504 [details]
screenshot of a cheat sheet in the tray
Comment 12 Curtis d'Entremont CLA 2005-12-09 17:20:42 EST
Created attachment 31505 [details]
screenshot with context help in the tray
Comment 13 Curtis d'Entremont CLA 2005-12-13 14:39:50 EST
Rolling back for M4 due to bug 119617 and the fact that we would have to fall back to infopops. Will reapply after M4.
Comment 14 Curtis d'Entremont CLA 2005-12-13 14:40:31 EST
Created attachment 31672 [details]
rollback patch for this one and 120285

Mazen, can you roll back these two?
Comment 15 Mazen Faraj CLA 2005-12-13 15:23:42 EST
applied patch...
Comment 16 Curtis d'Entremont CLA 2005-12-26 19:43:35 EST
Reapplied for M5.