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 38192 Details for
Bug 135946
Virtual Tree eats shell activations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
2 SWT shells with a virtual tree
MainApp.java (text/plain), 2.19 KB, created by
Paul Webster
on 2006-04-10 14:25:12 EDT
(
hide
)
Description:
2 SWT shells with a virtual tree
Filename:
MIME Type:
Creator:
Paul Webster
Created:
2006-04-10 14:25:12 EDT
Size:
2.19 KB
patch
obsolete
>package z.ex.swt; > >import org.eclipse.swt.SWT; >import org.eclipse.swt.custom.StyledText; >import org.eclipse.swt.layout.FillLayout; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Event; >import org.eclipse.swt.widgets.Listener; >import org.eclipse.swt.widgets.Shell; >import org.eclipse.swt.widgets.Tree; >import org.eclipse.swt.widgets.TreeItem; > >public class MainApp { > > /** > * @param args > */ > public static void main(String[] args) { > final Display display = new Display(); > Shell shell1 = new Shell(display); > shell1.setText("Shell-1"); > shell1.setLayout(new FillLayout()); > shell1.setSize(600, 300); > > shellContents(shell1); > > shell1.open(); > shell1.layout(); > > Shell shell2 = new Shell(display); > shell2.setText("Shell-2"); > shell2.setLayout(new FillLayout()); > shell2.setSize(600, 300); > > shellContents(shell2); > > shell2.open(); > shell2.layout(); > > final Listener listener = new Listener() { > public int fEventCounter = 0; > > public void handleEvent(Event event) { > ++fEventCounter; > if (!(event.widget instanceof Shell)) { > System.err.println("ASSP: handleEvent:" + fEventCounter > + ": " + event.widget); > return; > } > > final Shell newActiveShell = display.getActiveShell(); > System.err.println("ASSP: handleEvent:" + fEventCounter + ": " > + event.widget + "\n\tnewActiveShell: " > + newActiveShell); > } > }; > display.addFilter(SWT.Activate, listener); > > while (!shell1.isDisposed()) { > if (!display.readAndDispatch()) { > display.sleep(); > } > } > display.dispose(); > } > > private static void shellContents(Shell shell) { > StyledText text = new StyledText(shell, SWT.FULL_SELECTION | SWT.BORDER > | SWT.WRAP | SWT.V_SCROLL); > text > .setText("package ex;\n\npublic class Test {\n\tpublic static void log(String msg) {\n\t}\n}\n"); > > Tree tree = new Tree(shell, SWT.BORDER | SWT.VIRTUAL); > for (int i = 0; i < 3; i++) { > TreeItem item = new TreeItem(tree, SWT.NONE); > item.setText("top " + i); > for (int j = 0; j < 4; j++) { > TreeItem ji = new TreeItem(item, SWT.NONE); > ji.setText("one " + j); > for (int k = 0; k < 5; k++) { > TreeItem ki = new TreeItem(ji, SWT.NONE); > ki.setText("two " + k); > } > } > } > } > >}
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 135946
: 38192