Bug 388667 - API to get z-order of shells
Summary: API to get z-order of shells
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.3   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 389914
  Show dependency tree
 
Reported: 2012-09-03 07:11 EDT by Markus Keller CLA
Modified: 2013-02-12 11:46 EST (History)
1 user (show)

See Also:


Attachments
ShellOrderSnippet.java (1.76 KB, text/plain)
2012-09-03 07:11 EDT, Markus Keller CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2012-09-03 07:11:42 EDT
Created attachment 220651 [details]
ShellOrderSnippet.java

Add an API to get the z-Order of shells.

Composite#getChildren() already returns the children in z-Order, so I assumed that Shell#getShells() would do the same for child shells. For simple examples it does, but unfortunately, it's not reliable. When you run the attached  snippet on Windows and then close the "Child 2" shell, 

My goal is this:
- open a few non-modal child shells
- let the user activate and close child shells in any order
- when the user closes a child shell, automatically activate the frontmost remaining child shell (the default behavior on close is to activate the parent shell)

Best solution would be to specify that Shell#getShells() returns the child shells in z-Order.
Comment 1 Markus Keller CLA 2013-02-12 11:46:11 EST
Oops, second paragraph of comment 0 got cut. Completion:

> When you run the attached
> snippet on Windows and then close the "Child 2" shell,
then "Child 0" comes to front.

Expected: "Child 1" should be activated and stay in front of "Child 0".