Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JFace dialog always on top and modeless

I have created a JFace Modeless Dialog and trying to set shell style with following options

setShellStyle(SWT.CLOSE | SWT.TITLE |SWT.MODELESS |SWT.ON_TOP);

I want this dialog to be always on top , but the dialog gets minimized when I minimize the eclipse workbench.

Am I missing something with the shell style bits or is this the expected behavior?

How can I make an always on top dialog even if we minimize the eclipse application?

public class Capture extends Dialog {

    public Capture(Shell parentShell) {
        super(parentShell);
        setShellStyle(SWT.CLOSE | SWT.TITLE |SWT.MODELESS |SWT.ON_TOP);
    }

}
like image 934
Amrit Avatar asked Sep 05 '25 03:09

Amrit


2 Answers

Use null for the parent Shell so that the dialog is not a child of the window you are minimizing.

like image 188
greg-449 Avatar answered Sep 07 '25 20:09

greg-449


I don't have enough reputation to comment. So posting this as an answer. What is the parentShell in this? That determines the life and behavior of the dialog. Either create a new shell or put null as the shell. That should remove the tie up with the workbench. Another question : Why are trying this?

like image 39
Henry Avatar answered Sep 07 '25 21:09

Henry