Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Nebula RoundedSwitch"
m (→Usage: typo in class name [re]-fixed: correct name is RoundedSwitch) |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 17: | Line 17: | ||
You use this widget like a Button with <code>SWT.CHECKBOX</code> style : | You use this widget like a Button with <code>SWT.CHECKBOX</code> style : | ||
− | final RoundedSwitch button = new | + | final RoundedSwitch button = new RoundedSwitch(shell, SWT.NONE); |
button.setSelection(true); | button.setSelection(true); | ||
Line 27: | Line 27: | ||
This example is also available here : | This example is also available here : | ||
− | [https://raw.githubusercontent.com/eclipse/nebula/master/widgets/ | + | [https://raw.githubusercontent.com/eclipse/nebula/master/widgets/roundedcheckbox/org.eclipse.nebula.widgets.roundedcheckbox.snippets/src/org/eclipse/nebula/widgets/roundedcheckbox/snippets/RoundedCheckBoxSnippet.java RoundedCheckBoxSnippet.java] |
Latest revision as of 19:17, 12 August 2020
Introduction
This widget is a checkbox widget that is represented by a switch button.
It has the same API than the Button
widget API, but the look is different.
Please notice that the widget only consists in a checkbox without text. You can not setText(something), you have to create a Label widget besides the checkbox.
Contents
Usage
You use this widget like a Button with SWT.CHECKBOX
style :
final RoundedSwitch button = new RoundedSwitch(shell, SWT.NONE); button.setSelection(true);
And voilà, it is done !
Examples
An example called RoundedSwitchSnippet.java is located in the plugin org.eclipse.nebula.widgets.roundedswitch.snippets.
This example is also available here : RoundedCheckBoxSnippet.java