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 287701 Details for
Bug 577860
SelectionListener is not called when invoking setSelection on Checkbox Button
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Snippet showing the problem
CheckBoxTest.java (text/x-java), 1.28 KB, created by
Alois Zoitl
on 2021-12-17 02:32:47 EST
(
hide
)
Description:
Snippet showing the problem
Filename:
MIME Type:
Creator:
Alois Zoitl
Created:
2021-12-17 02:32:47 EST
Size:
1.28 KB
patch
obsolete
>package checkboxtest; > >import org.eclipse.jface.widgets.WidgetFactory; >import org.eclipse.swt.SWT; >import org.eclipse.swt.events.SelectionAdapter; >import org.eclipse.swt.events.SelectionEvent; >import org.eclipse.swt.layout.FillLayout; >import org.eclipse.swt.widgets.Button; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Shell; > >public class CheckBoxTest { > > static boolean buttonState = false; > > public static void main(String[] args) { > Display display = new Display(); > final Shell shell = new Shell(display); > shell.setText("Check box selection callback test"); > shell.setLayout(new FillLayout()); > > Button button = WidgetFactory.button(SWT.CHECK).text("Check Button Test").create(shell); > button.setText("Check Button Test"); > button.addSelectionListener(new SelectionAdapter() { > @Override > public void widgetSelected(SelectionEvent e) { > buttonState = button.getSelection(); > System.out.println("New Button State: " + buttonState); > } > }); > > Button testButton = WidgetFactory.button(SWT.BORDER).text("Set checkbutton").create(shell); > testButton.addListener(SWT.Selection, e -> button.setSelection(true)); > > shell.pack(); > 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 577860
: 287701