Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 220651 Details for
Bug 388667
API to get z-order of shells
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
ShellOrderSnippet.java
ShellOrderSnippet.java (text/plain), 1.76 KB, created by
Markus Keller
on 2012-09-03 07:11:42 EDT
(
hide
)
Description:
ShellOrderSnippet.java
Filename:
MIME Type:
Creator:
Markus Keller
Created:
2012-09-03 07:11:42 EDT
Size:
1.76 KB
patch
obsolete
>package snippet; > >import java.util.*; > >import org.eclipse.swt.*; >import org.eclipse.swt.events.*; >import org.eclipse.swt.graphics.*; >import org.eclipse.swt.layout.*; >import org.eclipse.swt.widgets.*; > >public class ShellOrderSnippet { > > public static void main(String[] args) { > final Display display= new Display(); > final Shell shell= new Shell(display); > shell.setText("Main"); > shell.setBounds(100, 100, 200, 160); > shell.setLayout(new GridLayout()); > > Label temp= new Label(shell, SWT.NONE); > > shell.open(); > > for (int i= 0; i < 3; i++) { > Shell child= new Shell(shell, SWT.SHELL_TRIM); > child.setText("Child " + i); > Rectangle bounds= shell.getBounds(); > bounds.x+= 20 * (i + 1); > bounds.y+= 20 * (i + 1); > child.setBounds(bounds); > child.open(); > child.addShellListener(new ShellAdapter() { > public void shellClosed(ShellEvent e) { > display.asyncExec(new Runnable() { > public void run() { > Shell[] subShells= shell.getShells(); > System.out.println(Arrays.asList(subShells)); > if (subShells.length > 0) { > subShells[subShells.length - 1].setActive(); > } > } > }); > } > }); > > if (temp != null) { > temp.dispose(); > temp= null; > } > } > > > while (!shell.isDisposed()) { > if (!display.readAndDispatch()) > display.sleep(); > } > display.dispose(); > > } > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 388667
: 220651