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 282988 Details for
Bug 563393
[GTK] Crash on selection in Tree
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.
SWT snippet to reproduce the problem with. Alternate clicks on the combo, tree and scrolling in the tree.
Bug563393_TreeFocusLostReplaceItems.java (text/x-java), 1.65 KB, created by
Simeon Andreev
on 2020-05-22 02:54:07 EDT
(
hide
)
Description:
SWT snippet to reproduce the problem with. Alternate clicks on the combo, tree and scrolling in the tree.
Filename:
MIME Type:
Creator:
Simeon Andreev
Created:
2020-05-22 02:54:07 EDT
Size:
1.65 KB
patch
obsolete
>package test; > >import org.eclipse.swt.SWT; >import org.eclipse.swt.events.FocusAdapter; >import org.eclipse.swt.events.FocusEvent; >import org.eclipse.swt.layout.FillLayout; >import org.eclipse.swt.widgets.Combo; >import org.eclipse.swt.widgets.Composite; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Shell; >import org.eclipse.swt.widgets.Tree; >import org.eclipse.swt.widgets.TreeItem; > >/* > * Title: Bug 563393 - [GTK] Crash on selection in Tree > * How to run: Launch the snippet and alternate clicking on the combo (top), > * clicking in the tree (bottom) and scrolling in the tree. > * Bug description: JDK crashes in GTK3 code. > * Expected results: No crash. > * GTK Version(s): GTK3 > */ >public class Bug563393_TreeFocusLostReplaceItems { > > public static void main(String[] args) { > Display display = new Display(); > Shell shell = new Shell(display); > shell.setSize(600, 400); > shell.setLayout(new FillLayout()); > Composite composite = new Composite(shell, SWT.NONE); > composite.setLayout(new FillLayout(SWT.VERTICAL)); > > Combo c = new Combo(composite, SWT.NONE); > c.add("1"); > c.add("2"); > > int n = 20; > > Tree tree = new Tree(composite, SWT.NONE); > tree.addFocusListener(new FocusAdapter() { > @Override > public void focusLost(FocusEvent e) { > tree.removeAll(); > addElements(tree, n); > } > }); > addElements(tree, n); > > shell.open(); > while (!shell.isDisposed()) { > if (!display.readAndDispatch()) > display.sleep(); > } > display.dispose(); > } > > private static void addElements(Tree tree, int n) { > for (int i = 0; i < n; ++i) { > TreeItem item = new TreeItem(tree, SWT.NONE); > item.setText("String " + i); > } > } >}
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 563393
:
282951
|
282952
|
282971
|
282974
|
282987
| 282988 |
283005