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 287767 Details for
Bug 578025
SWT.Skin event sent in wrong order (child before parent)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Snippet to reproduce
SkinEventSentInWrongOrder.java (text/plain), 1.37 KB, created by
Thomas Singer
on 2022-01-03 08:20:48 EST
(
hide
)
Description:
Snippet to reproduce
Filename:
MIME Type:
Creator:
Thomas Singer
Created:
2022-01-03 08:20:48 EST
Size:
1.37 KB
patch
obsolete
>import org.eclipse.swt.*; >import org.eclipse.swt.layout.*; >import org.eclipse.swt.widgets.*; > >/** > * @author Thomas Singer > */ >public class SkinEventSentInWrongOrder { > > public static void main(String[] args) { > final Display display = new Display(); > > display.addListener(SWT.Skin, event -> { > System.out.println(event.widget.getClass()); > if (event.widget instanceof Shell) { > final Shell shell = (Shell)event.widget; > shell.setForeground(display.getSystemColor(SWT.COLOR_YELLOW)); > shell.setBackground(display.getSystemColor(SWT.COLOR_GRAY)); > } > else if (event.widget instanceof Control) { > final Control control = (Control)event.widget; > final Composite parent = control.getParent(); > control.setForeground(parent.getForeground()); > control.setBackground(parent.getBackground()); > } > }); > > final Shell shell = new Shell(display); > shell.setLayout(new FillLayout()); > > final Composite initialParent = new Composite(shell, 0); > > final Label label = new Label(initialParent, 0); > label.setText("hello world"); > > final Composite newParent = new Composite(shell, 0); > newParent.setLayout(new GridLayout()); > label.setParent(newParent); > > shell.setSize(400, 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 578025
: 287767 |
287768