Skip to main content
Jump to: navigation, search

Difference between revisions of "Nebula RoundedSwitch"

(Created page with "< Back to Nebula Main Page =Introduction= File:Roundedswitch.PNG This widget is a checkbox widget that is represented by a switch button. It has the same A...")
 
 
(One intermediate revision 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 RoundedCheckbox button = new RoundedCheckbox(shell, SWT.NONE);
+
   final RoundedSwitch button = new RoundedCheckbox(shell, SWT.NONE);
 
   button.setSelection(true);
 
   button.setSelection(true);
 
 
This widget accepts TRI-STATE :
 
 
  final RoundedCheckbox button = new RoundedCheckbox(shell, SWT.NONE);
 
  button.setSelection(true);
 
  button.setGrayed(true);
 
  button.setEnabled(false);
 
 
  
 
And ''voilà'', it is done !
 
And ''voilà'', it is done !
 
  
 
=Examples=
 
=Examples=
  
An example called '''RoundedCheckBoxSnippet.java''' is located in the plugin '''org.eclipse.nebula.widgets.roundedcheckbox.snippets'''.
+
An example called '''RoundedSwitchSnippet.java''' is located in the plugin '''org.eclipse.nebula.widgets.roundedswitch.snippets'''.
  
 
This example is also available here :
 
This example is also available here :
[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]
+
[https://raw.githubusercontent.com/eclipse/nebula/master/widgets/roundedswitch/org.eclipse.nebula.widgets.roundedswitch.snippets/src/org/eclipse/nebula/widgets/roundedswitch/snippets/RoundedSwitchSnippet.java RoundedSwitchSnippet.java]

Latest revision as of 14:30, 28 July 2020

< Back to Nebula Main Page

Introduction

Roundedswitch.PNG

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.

Usage

You use this widget like a Button with SWT.CHECKBOX style :

 final RoundedSwitch button = new RoundedCheckbox(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 : RoundedSwitchSnippet.java

Back to the top