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 266224 Details for
Bug 510240
[Cocoa] SWT.TOOL-shell influences the painting of TreeItems
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Sample code to reproduce
ThemedTree.java (text/plain), 1.92 KB, created by
Thomas Singer
on 2017-01-11 05:09:35 EST
(
hide
)
Description:
Sample code to reproduce
Filename:
MIME Type:
Creator:
Thomas Singer
Created:
2017-01-11 05:09:35 EST
Size:
1.92 KB
patch
obsolete
>import org.eclipse.swt.*; >import org.eclipse.swt.layout.*; >import org.eclipse.swt.widgets.*; > >/** > * @author Thomas Singer > */ >public class ThemedTree { > > public static void main(String[] args) { > final Display display = new Display(); > > final Shell shell = new Shell(display, SWT.SHELL_TRIM | SWT.TOOL); > shell.setLayout(new FillLayout()); > > final Tree tree = new Tree(shell, SWT.SINGLE | SWT.BORDER); > TreeItem item = createItem(tree, "Commands"); > createItem(item, "Log"); > createItem(item, "Refresh"); > createItem(item, "Background Commands"); > createItem(item, "Executables"); > createItem(item, "Authentication"); > item = createItem(tree, "User Interface"); > createItem(item, "Built-in Text Editors"); > > tree.addListener(SWT.EraseItem, event -> { > if ((event.detail & SWT.SELECTED) != 0) { > final Control control = (Control)event.widget; > event.gc.setBackground(display.getSystemColor(control.isFocusControl() ? SWT.COLOR_BLUE : SWT.COLOR_DARK_GRAY)); > event.gc.fillRectangle(event.x, event.y, event.width, event.height); > > event.gc.setForeground(display.getSystemColor(control.isFocusControl() ? SWT.COLOR_GRAY : SWT.COLOR_WHITE)); > } > }); > tree.setBackground(display.getSystemColor(SWT.COLOR_BLACK)); > tree.setForeground(display.getSystemColor(SWT.COLOR_GRAY)); > > new Text(shell, SWT.BORDER); > > shell.setSize(400, 300); > shell.open(); > > while (!shell.isDisposed()) { > if (!display.readAndDispatch()) { > display.sleep(); > } > } > > display.dispose(); > } > > private static TreeItem createItem(Tree parent, String text) { > final TreeItem treeItem = new TreeItem(parent, SWT.NONE); > treeItem.setText(text); > return treeItem; > } > > private static void createItem(TreeItem parent, String text) { > final TreeItem treeItem = new TreeItem(parent, SWT.NONE); > treeItem.setText(text); > > if (parent.getItemCount() == 1) { > parent.setExpanded(true); > } > } >}
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 510240
: 266224 |
266225
|
266226