Package org.eclipse.swt.widgets

# Class TaskBar

java.lang.Object
org.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.TaskBar

All Implemented Interfaces:
  `Adaptable`

public class TaskBar extends Widget
Instances of this class represent the system task bar.

Styles:
  (none)
Events:
  (none)

Since:
  1.4
See Also:
  - `Display.getSystemTaskBar()`
  - Sample code and further information

## Constructor Summary

Constructors
Constructor
Description
`TaskBar()`

## Method Summary

Modifier and Type
Method
Description
`TaskItem`
`getItem(int index)`
Returns the item at the given, zero-relative index in the receiver.
`TaskItem`
`getItem(Shell shell)`
Returns the `TaskItem` for the given `Shell` or the `TaskItem` for the application if the `Shell` parameter is `null`.
`int`
`getItemCount()`
Returns the number of items contained in the receiver.
`TaskItem[]`
`getItems()`
Returns an array of `TaskItem`s which are the items in the receiver.

### Methods inherited from class org.eclipse.swt.widgets.Widget

`addDisposeListener, addListener, checkSubclass, checkWidget, dispose, getAdapter, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### TaskBar

public TaskBar()

## Method Details

### getItem

public TaskItem getItem(int index)
Returns the item at the given, zero-relative index in the receiver. Throws an exception if the index is out of range.

Parameters:
  `index` - the index of the item to return
Returns:
  the item at the given index
Throws:
  `IllegalArgumentException` -
  - ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)
  `SWTException` -
  - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

### getItem

public TaskItem getItem(Shell shell)
Returns the `TaskItem` for the given `Shell` or the `TaskItem` for the application if the `Shell` parameter is `null`. If the requested item is not supported by the platform it returns `null`.

Parameters:
  `shell` - the shell for which the task item is requested, or null to request the application item
Returns:
  the task item for the given shell or the application
Throws:
  `SWTException` -
  - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

### getItemCount

public int getItemCount()
Returns the number of items contained in the receiver.

Returns:
  the number of items
Throws:
  `SWTException` -
  - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

### getItems

public TaskItem[] getItems()
Returns an array of `TaskItem`s which are the items in the receiver.

Note: This is not the actual structure used by the receiver to maintain its list of items, so modifying the array will not affect the receiver.

Returns:
  the items in the receiver
Throws:
  `SWTException` -
  - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver