Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: for the plan.

Jump to: navigation, search

Nebula SegmentedBar

< Back to Nebula Main Page



A widget that displays a horizontal bar that visualizes the segmentation of a total value. It consists of several segments, each segment representing a value. The sum of all values is the total value of the bar.


The first thing to do is to instantiate the widget, then you add segment(s) (by calling the methods setSegments or addSegment).

SegmentedBar sb1 = new SegmentedBar(shell, SWT.NONE);

The spacing between different segments can changed by using the method setSpacing on the SegmentedBar widget.

You can customize also a segment :

  • Specify a text : setText()
  • Specify a tooltip : setTooltip()
  • Specify a numeric (Double) value : setValue()
  • Specify a font : setFont()
  • Specify a background color : setBackground()
  • Specify a foreground color (for the text) : setForeground()

You can also store data : setData(Object value) and setData(String key, Object value)

Segment is based on the Builder pattern, so you chain setters.


An example called is located in the plugin org.eclipse.nebula.widgets.segmentedbar.snippets.

This example is also available here :

Copyright © Eclipse Foundation, Inc. All Rights Reserved.