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 Stepbar
Introduction
This widget displays a progress using a list of steps. It can be used for long forms splitted in different pages.
Contents
Usage
The first thing to do is instatiate the widget. 3 style flags can be applied : SWT.BORDER to display a border around the widget, SWT.TOP to display the text above the lines and circles (this is the default value), and SWT.BOTTOM to display the text under the lines.
Stepbar bar = new Stepbar(shell, SWT.BOTTOM | SWT.BORDER);
Then you specify the labels (one per each step), by using the setSteps method (the argument can be an array of strings or a list).
bar.setSteps(new String[] { "First step", "Second step", "Third step" });
The current step is represented by a grey circle. When a step is done, it is represented by a filled blue circle with a ticker.
You can set the current step by using the method setCurrentStep. The argument is zero-based (0 for the the first step, 1 for the second...)
bar.setCurrentStep(2);
If you want to specify that the current step is in error, you have to call the method setErrorState
bar.setErrorState(true);
Example
An example called StepBarSnippet.java is located in the plugin org.eclipse.nebula.widgets.stepbar.snippets.
This example is also available here : StepBarSnippet.java