Skip to content

ProgressBar

mlabuda edited this page Feb 18, 2014 · 3 revisions

API / Abstract

  • ProgressBar / AbstractProgressBar, DeterminateProgressBar

Implementation(s)

  • HorizontalProgressBar
  • VerticalProgressBar
  • IndeterminateProgressBar

Description

There are 2 types of progress bar.

  • First one includes all descendants of abstract class DeterminateProgressBar and allows read progress bar state.
  • Second one is IndeterminateProgressBar. This does not allow to read progress bar state.

Usage

HorizontalProgressBar

Horizontal progress bar is determined progress bar.

Look up a horizontal progress bar with index 0

HorizontalProgressBar horizontalBar = new HorizontalProgressBar(0); 

Get minimum value of horizontal progress bar

int minimum = horizontalBar.getMinimum();

Get maximum value of horizontal progress bar

int maximum = horizontalBar.getMaximum();

Get current value of horizontal progress bar

int currentValue = horizontalBar.getSelection();

VerticalProgressBar

Vertical progress bar is determined progress bar.

Look up a vertical progress bar with index 0

VerticalProgressBar verticalBar = new VerticalProgressBar(0); 

Get minimum value of vertical progress bar

int minimum = verticalBar.getMinimum();

Get maximum value of vertical progress bar

int maximum = verticalBar.getMaximum();

Get current value of vertical progress bar

int currentValue = verticalBar.getSelection();

IndeterminateProgressBar

Look up a indeterminate progress bar with index 0

IndeterminateProgressBar indeterminateBar = new IndeterminateProgressBar(0); 

Shared functionality

On some platforms is possible to check state of progress bar. Not every platform has to support this feature. There are 3 states: SWT.NORMAL, SWT.ERROR, SWT.PAUSED. To check the state of progress bar use the following code:

int state = bar.getState();
Clone this wiki locally