Summary: | Provide API to make a jface.Dialog non-modal and using a top-level shell | ||
---|---|---|---|
Product: | [Eclipse Project] Platform | Reporter: | Lars Vogel <Lars.Vogel> |
Component: | UI | Assignee: | Platform-UI-Inbox <Platform-UI-Inbox> |
Status: | NEW --- | QA Contact: | |
Severity: | enhancement | ||
Priority: | P3 | CC: | akurtakov, daniel_megert, Lars.Vogel, psuzzi, sxenos |
Version: | 4.5 | Keywords: | api |
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Linux | ||
Whiteboard: | |||
Bug Depends on: | |||
Bug Blocks: | 506677 |
Description
Lars Vogel
2016-10-26 16:13:17 EDT
Stefan / Alex / Dani, any suggestion how to archive this via new or existing API? > AFAIK we currently have no way to make a dialog a top-level shell, e.g.,
> so that I switch between the dialog and the application window with Ctrl+tab.
If you give it a null parent and make it non-modal, it should end up as a top-level shell.
We reparent modal dialogs to prevent deadlocks.
(In reply to Stefan Xenos from comment #2) > > AFAIK we currently have no way to make a dialog a top-level shell, e.g., > > so that I switch between the dialog and the application window with Ctrl+tab. > > If you give it a null parent and make it non-modal, it should end up as a > top-level shell. > > We reparent modal dialogs to prevent deadlocks. But as Lars said, you need to override setShellStyle() for this. Checking the sources of org.eclipse.jface.dialogs.Dialog you will notice that SWT.APPLICATION_MODAL is set always. But AFAIK you don't need to override setShellStyle. Most existing dialogs that wish to change the style bits do something like this in their constructor: setShellStyle(getShellStyle() | SWT.RESIZE); So if you want to make a nonmodal top-level dialog, you could do this: public MyDialog() { super((Shell) null); setShellStyle(SWT.CLOSE | SWT.MODELESS | SWT.BORDER | SWT.TITLE); } Is there something I'm missing? Is there a reason why this either doesn't work, is undesirable, or is too verbose? |