Eclipse RCP, SWT, JFace: How to create a dialog that is modal only to a view (not the entire shell)?

I think it won't be so easy to implement. One possibility is that instead of using a modal dialog in View A, you use a TabFolder. Then, you can open the contents of the dialog in a new Tab instead and force this tab to stay on top until you dismiss it.

This is a similar behavior to the one you need.

I think it won't be so easy to implement. One possibility is that instead of using a modal dialog in View A, you use a TabFolder. Then, you can open the contents of the dialog in a new Tab instead and force this tab to stay on top until you dismiss it.

This is a similar behavior to the one you need. This will also allow you to drag and drop something from View B into View A.

Thanks! That was useful. But I figured out that I should probably explain what my actual problem was, so you could probably have a better picture of it and have other suggestions.

I have two views, A and B. The only way to get to view B is by clicking an entry in view A. Indeed, the input of view B comes from the entry being clicked in view A.

The problem is when the user left view B opened when closing the app and the next time it is run again view B would be opened automatically (setSaveAndRestore(true)), but coz it has no input, it appears empty. – Her Apr 29 '09 at 12:43 (Sorry, I didn't realized how long was my above comment -- here is the continuation) So what I wanted to do in the case mentioned above was present a dialog (or something else) and list the inputs possible for view B for the user to select. I didn't want the dialog to block the entire app, so the user can decide to ignore the dialog and switch to other views freely.

I guess using TabFolder as you suggested will work, but I am not sure in terms of how it could be integrated into view B on demand (when the input is not present) because view B itself has its own control widgets. Thanks. – Her Apr 29 '09 at 12:49.

The whole idea of workbench restore is to put the workbench back into the state it was in before. It does not have to restore every little detail but if you don't want to leave the view blank then you should restore it to its original state. That means view B should be restored with the same input that it had when you closed the workbench.

If view B and its input continue to exist after view A is closed then view B and its input can be restored, regardless of whether view A exists or not. You certainly should not be opening dialog boxes during workbench restore. That would not be good UI design.

Eclipse provides a very easy to use memento framework that can save a view's input. Use it. If you are not familiar with mementos, see for example wiki.eclipse.org/FAQ_How_does_a_view_per....

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions