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.
Nebula NebulaSlider
Introduction
Contents
This widget is an other visualisation of a Slider. It represents an integer value which is in a range of data.
Important: This widget is currently horizontal. If you need a vertical slider, please fill a bug with Bugzilla
Usage
The usage is very simple :
- You create a NebulaSlider widget
- You set the minimum value, the maximum value and the value with the appropriate setters (
setMinimum(),setMaximum()andsetValue()). - You can add a SelectionListener with the method
addSelectionListener(). The selection event is fired when the user changes the selection.
final NebulaSlider slider = new NebulaSlider(shell, SWT.NONE);
slider.setMinimum(0);
slider.setMaximum(1000);
slider.setValue(632);
slider.setBackground(display.getSystemColor(SWT.COLOR_WHITE));
slider.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
System.out.println("New value is " + slider.getValue());
}
});
Example
An example called NebulaSliderSnippet is located in the plugin org.eclipse.nebula.widgets.nebulaslider.snippets.
This example is also available here : NebulaSliderSnippet.java
