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 267404 Details for
Bug 514066
[Cocoa] Tree: inconsistent selection problem when collapsing parent node
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.
Sample code
TreeSelectionTest.java (text/plain), 1.52 KB, created by
Thomas Singer
on 2017-03-22 10:28:42 EDT
(
hide
)
Description:
Sample code
Filename:
MIME Type:
Creator:
Thomas Singer
Created:
2017-03-22 10:28:42 EDT
Size:
1.52 KB
patch
obsolete
>import org.eclipse.swt.*; >import org.eclipse.swt.layout.*; >import org.eclipse.swt.widgets.*; > >/** > * @author Thomas Singer > */ >public class TreeSelectionTest { > > public static void main(String[] args) { > final Display display = new Display(); > final Shell shell = new Shell(display); > shell.setLayout(new GridLayout()); > > final Tree tree = new Tree(shell, SWT.BORDER); > tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); > for (int i = 0; i < 2; i++) { > final TreeItem rootNode = new TreeItem(tree, 0); > rootNode.setText("TreeItem (0) -" + i); > for (int j = 0; j < 4; j++) { > final TreeItem childNode = new TreeItem(rootNode, 0); > childNode.setText("TreeItem (1) -" + j); > if (i == 0 && j == 0) { > tree.setSelection(childNode); > } > } > rootNode.setExpanded(true); > } > > tree.addListener(SWT.Selection, new Listener() { > @Override > public void handleEvent(Event event) { > System.out.println(tree.getSelectionCount() + " node(s) selected"); > } > }); > > final Button button = new Button(shell, SWT.PUSH); > button.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false)); > button.setText("Collapse 1st Root Node"); > button.addListener(SWT.Selection, new Listener() { > @Override > public void handleEvent(Event event) { > tree.getItem(0).setExpanded(false); > } > }); > > shell.setSize(300, 300); > shell.open(); > 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 514066
: 267404 |
267405
|
267406
|
267408