Bug 388667

Summary: API to get z-order of shells
Product: [Eclipse Project] Platform Reporter: Markus Keller <markus.kell.r>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: Silenio_Quarti
Version: 4.3   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on:    
Bug Blocks: 389914    
Attachments:
Description Flags
ShellOrderSnippet.java none

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".