Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Nebula Stepbar

< Back to Nebula Main Page

Introduction

Stepbar.png

This widget displays a progress using a list of steps. It can be used for long forms splitted in different pages.

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

Back to the top