Skip to main content
Jump to: navigation, search

Nebula SegmentedBar

Revision as of 11:42, 31 October 2020 by (Talk | contribs) (Created page with "< Back to Nebula Main Page ==Introduction== File:Segmentedbar.png A widget that displays a horizontal bar that visualizes the segmentation of a total value....")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

< 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 :

Back to the top