org.eclipse.nebula.widgets.grid

## Class Grid

- java.lang.Object
- - org.eclipse.swt.widgets.Widget
  - - org.eclipse.swt.widgets.Control
    - - org.eclipse.swt.widgets.Scrollable
      - - org.eclipse.swt.widgets.Composite
        - - org.eclipse.nebula.widgets.grid.Grid

All Implemented Interfaces:
  Adaptable, Drawable

    public class Grid
    extends Composite

Instances of this class implement a selectable user interface object that displays a list of images and strings and issue notification when selected.

The item children that may be added to instances of this class must be of type `GridItem`.

Styles:
  SWT.SINGLE, SWT.MULTI, SWT.NO_FOCUS, SWT.CHECK, SWT.VIRTUAL
Events:
  Selection, DefaultSelection

### Constructor Summary

Constructors
Constructor and Description
`Grid(Composite parent, int style)` Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addSelectionListener(SelectionListener listener)` Adds the listener to the collection of listeners who will be notified when the receiver's selection changes, by sending it one of the messages defined in the `SelectionListener` interface.
`void` `addTreeListener(TreeListener listener)` Adds the listener to the collection of listeners who will be notified when the receiver's items changes, by sending it one of the messages defined in the `TreeListener` interface.
`void` `clear(int[] indices, boolean allChildren)` Clears the items at the given zero-relative indices in the receiver.
`void` `clear(int index, boolean allChildren)` Clears the item at the given zero-relative index in the receiver.
`void` `clear(int start, int end, boolean allChildren)` Clears the items in the receiver which are between the given zero-relative start and end indices (inclusive).
`void` `clearAll(boolean allChildren)` Clears all the items in the receiver.
`Point` `computeSize(int wHint, int hHint, boolean changed)` Returns the preferred size of the receiver.
`void` `deselect(int index)` Deselects the item at the given zero-relative index in the receiver.
`void` `deselect(int[] indices)` Deselects the items at the given zero-relative indices in the receiver.
`void` `deselect(int start, int end)` Deselects the items at the given zero-relative indices in the receiver.
`void` `deselectAll()` Deselects all selected items in the receiver.
`void` `deselectAllCells()` Deselects all selected cells in the receiver.
`void` `deselectCell(Point cell)` Deselects the given cell in the receiver.
`void` `deselectCells(Point[] cells)` Deselects the given cells.
`<T> T` `getAdapter(java.lang.Class<T> adapter)` Implementation of the `Adaptable` interface.
`Point` `getCell(Point point)` Returns the cell at the given point in the receiver or null if no such cell exists.
`Point[]` `getCellSelection()` Returns an array of cells that are currently selected in the receiver.
`int` `getCellSelectionCount()` Returns the number of selected cells contained in the receiver.
`boolean` `getCellSelectionEnabled()` Returns true if the cells are selectable in the reciever.
`GridColumn` `getColumn(int index)` Returns the column at the given, zero-relative index in the receiver.
`GridColumn` `getColumn(Point point)` Returns the column at the given point in the receiver or null if no such column exists.
`int` `getColumnCount()` Returns the number of columns contained in the receiver.
`GridColumnGroup` `getColumnGroup(int index)` Returns the column group at the given, zero-relative index in the receiver.
`int` `getColumnGroupCount()` Returns the number of column groups contained in the receiver.
`GridColumnGroup[]` `getColumnGroups()` Returns an array of `GridColumnGroup`s which are the column groups in the receiver.
`int[]` `getColumnOrder()` Returns an array of zero-relative integers that map the creation order of the receiver's items to the order in which they are currently being displayed.
`GridColumn[]` `getColumns()` Returns an array of `GridColumn`s which are the columns in the receiver.
`Point` `getFocusCell()` Returns the current cell in focus.
`GridColumn` `getFocusColumn()` Returns the current column in focus.
`GridItem` `getFocusItem()` Returns the current item in focus.
`int` `getFooterHeight()` Returns the height of the column footers.
`boolean` `getFooterVisible()` Returns `true` if the receiver's footer is visible, and `false` otherwise
`int` `getGroupHeaderHeight()` Returns the height of the column group headers.
`int` `getHeaderHeight()` Returns the height of the column headers.
`boolean` `getHeaderVisible()` Returns `true` if the receiver's header is visible, and `false` otherwise.
`protected IScrollBarProxy` `getHorizontalScrollBarProxy()`
`GridItem` `getItem(int index)` Returns the item at the given, zero-relative index in the receiver.
`GridItem` `getItem(Point point)` Returns the item at the given point in the receiver or null if no such item exists.
`int` `getItemCount()` Returns the number of items contained in the receiver.
`int` `getItemHeight()` Returns the default height of the items in this `Grid`.
`GridItem[]` `getItems()` Returns a (possibly empty) array of `GridItem`s which are the items in the receiver.
`boolean` `getLinesVisible()` Returns true if the lines are visible.
`GridColumn` `getNextVisibleColumn(GridColumn column)` Returns the next visible column in the table.
`GridItem` `getNextVisibleItem(GridItem item)` Returns the next visible item in the table.
`GridColumn` `getPreviousVisibleColumn(GridColumn column)` Returns the previous visible column in the table.
`GridItem` `getPreviousVisibleItem(GridItem item)` Returns the previous visible item in the table.
`GridItem` `getRootItem(int index)` TODO: JavaDoc
`int` `getRootItemCount()` Returns the number of root items contained in the receiver.
`GridItem[]` `getRootItems()` Returns a (possibly empty) array of `GridItem`s which are the root items in the receiver.
`GridItem[]` `getSelection()` Returns a array of `GridItem`s that are currently selected in the receiver.
`int` `getSelectionCount()` Returns the number of selected items contained in the receiver.
`boolean` `getSelectionEnabled()` Returns `true` if selection is enabled, false otherwise.
`int` `getSelectionIndex()` Returns the zero-relative index of the item which is currently selected in the receiver, or -1 if no item is selected.
`int[]` `getSelectionIndices()` Returns the zero-relative indices of the items which are currently selected in the receiver.
`int` `getTopIndex()` Returns the zero-relative index of the item which is currently at the top of the receiver.
`protected IScrollBarProxy` `getVerticalScrollBarProxy()`
`int` `indexOf(GridColumn column)` Searches the receiver's list starting at the first column (index 0) until a column is found that is equal to the argument, and returns the index of that column.
`int` `indexOf(GridItem item)` Searches the receiver's list starting at the first item (index 0) until an item is found that is equal to the argument, and returns the index of that item.
`boolean` `isAutoHeight()` Returns the value of the auto-height feature, which resizes row heights and column header heights based on word-wrapped content.
`boolean` `isCellSelected(Point cell)` Returns true if the given cell is selected.
`boolean` `isCellSelectionEnabled()` Returns true if the cells are selectable in the reciever.
`boolean` `isSelected(GridItem item)` Returns true if the given item is selected.
`boolean` `isSelected(int index)` Returns `true` if the item is selected, and `false` otherwise.
`void` `recalculateHeader()` Recalculate the height of the header
`void` `remove(int index)` Removes the item from the receiver at the given zero-relative index.
`void` `remove(int[] indices)` Removes the items from the receiver's list at the given zero-relative indices.
`void` `remove(int start, int end)` Removes the items from the receiver which are between the given zero-relative start and end indices (inclusive).
`void` `removeAll()` Removes all of the items from the receiver.
`void` `removeSelectionListener(SelectionListener listener)` Removes the listener from the collection of listeners who will be notified when the receiver's selection changes.
`void` `removeTreeListener(TreeListener listener)` Removes the listener from the collection of listeners who will be notified when the receiver's items changes.
`void` `select(int index)` Selects the item at the given zero-relative index in the receiver.
`void` `select(int[] indices)` Selects the items at the given zero-relative indices in the receiver.
`void` `select(int start, int end)` Selects the items in the range specified by the given zero-relative indices in the receiver.
`void` `selectAll()` Selects all of the items in the receiver.
`void` `selectAllCells()` Selects all cells in the receiver.
`void` `selectCell(Point cell)` Selects the given cell.
`void` `selectCells(Point[] cells)` Selects the given cells.
`void` `selectColumn(int col)` Selects all cells in the given column in the receiver.
`void` `selectColumnGroup(GridColumnGroup colGroup)` Selects all cells in the given column group in the receiver.
`void` `selectColumnGroup(int colGroup)` Selects all cells in the given column group in the receiver.
`void` `setAutoHeight(boolean autoHeight)` Sets the value of the auto-height feature.
`void` `setCellSelection(Point cell)` Selects the selection to the given cell.
`void` `setCellSelection(Point[] cells)` Selects the selection to the given set of cell.
`void` `setCellSelectionEnabled(boolean cellSelection)` Sets whether cells are selectable in the receiver.
`void` `setColumnOrder(int[] order)` Sets the order that the items in the receiver should be displayed in to the given argument which is described in terms of the zero-relative ordering of when the items were added.
`void` `setData(java.lang.String key, java.lang.Object value)` Sets the application defined property of the receiver with the specified name to the given value.
`void` `setFocusColumn(GridColumn column)` Sets the focused column to the given column.
`void` `setFocusItem(GridItem item)` Sets the focused item to the given item.
`void` `setFont(Font font)` Sets the font that the receiver will use to paint textual information to the font specified by the argument, or to the default font for that kind of control if the argument is null.
`void` `setFooterVisible(boolean show)` Marks the receiver's footer as visible if the argument is `true`, and marks it invisible otherwise.
`void` `setHeaderVisible(boolean show)` Marks the receiver's header as visible if the argument is `true`, and marks it invisible otherwise.
`void` `setItemCount(int count)` Sets the number of items contained in the receiver.
`void` `setItemHeight(int height)` Sets the default height for this `Grid`'s items.
`void` `setLinesVisible(boolean linesVisible)` Sets the line visibility.
`void` `setSelection(GridItem[] items)` Sets the receiver's selection to be the given array of items.
`void` `setSelection(int index)` Selects the item at the given zero-relative index in the receiver.
`void` `setSelection(int[] indices)` Selects the items at the given zero-relative indices in the receiver.
`void` `setSelection(int start, int end)` Selects the items in the range specified by the given zero-relative indices in the receiver.
`void` `setSelectionEnabled(boolean selectionEnabled)` Enables selection highlighting if the argument is `true`.
`void` `setTopIndex(int index)` Sets the zero-relative index of the item which is currently at the top of the receiver.
`void` `showColumn(GridColumn column)` Shows the column.
`void` `showItem(GridItem item)` Shows the item.
`void` `showSelection()` Shows the selection.

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

`changed, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList`

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

`computeTrim, getClientArea, getHorizontalBar, getVerticalBar`

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

`addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addTouchListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getShell, getSize, getToolTipText, getTouchEnabled, getVisible, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCursor, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setSize, setSize, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, update`

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

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

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

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

### Constructor Detail

#### Grid

    public Grid(Composite parent,
                int style)

Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.

Parameters:
  `parent` - a composite control which will be the parent of the new instance (cannot be null)
  `style` - the style of control to construct
Throws:
  `java.lang.IllegalArgumentException` -
  - ERROR_NULL_ARGUMENT - if the parent is null
  `SWTException` -
  - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
See Also:
  `SWT.SINGLE`, `SWT.MULTI`

### Method Detail

#### computeSize

    public Point computeSize(int wHint,
                             int hHint,
                             boolean changed)

Returns the preferred size of the receiver.

The preferred size of a control is the size that it would best be displayed at. The width hint and height hint arguments allow the caller to ask a control questions such as "Given a particular width, how high does the control need to be to show all of the contents?" To indicate that the caller does not wish to constrain a particular dimension, the constant `SWT.DEFAULT` is passed for the hint.

If the changed flag is `true`, it indicates that the receiver's contents have changed, therefore any caches that a layout manager containing the control may have been keeping need to be flushed. When the control is resized, the changed flag will be `false`, so layout manager caches can be retained.

Overrides:
  `computeSize` in class `Composite`
Parameters:
  `wHint` - the width hint (can be `SWT.DEFAULT`)
  `hHint` - the height hint (can be `SWT.DEFAULT`)
  `changed` - `true` if the control's contents have changed, and `false` otherwise
Returns:
  the preferred size of the control.
See Also:
  `Layout`, `Control.getBorderWidth()`, `Control.getBounds()`, `Control.getSize()`, `Control.pack(boolean)`, "computeTrim, getClientArea for controls that implement them"

#### addSelectionListener

    public void addSelectionListener(SelectionListener listener)

Adds the listener to the collection of listeners who will be notified when the receiver's selection changes, by sending it one of the messages defined in the `SelectionListener` interface.

Cell selection events may have `Event.detail = SWT.DRAG` when the user is drag selecting multiple cells. A follow up selection event will be generated when the drag is complete.

Parameters:
  `listener` - the listener which should be notified
Throws:
  `java.lang.IllegalArgumentException` -
  - ERROR_NULL_ARGUMENT - if the listener is null
  `SWTException` -
  - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

#### removeSelectionListener

    public void removeSelectionListener(SelectionListener listener)

Removes the listener from the collection of listeners who will be notified when the receiver's selection changes.

Parameters:
  `listener` - the listener which should no longer be notified
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
See Also:
  `SelectionListener`, `addSelectionListener(SelectionListener)`

#### addTreeListener

    public void addTreeListener(TreeListener listener)

Adds the listener to the collection of listeners who will be notified when the receiver's items changes, by sending it one of the messages defined in the `TreeListener` interface.

Parameters:
  `listener` - the listener which should be notified
Throws:
  `java.lang.IllegalArgumentException` -
  - ERROR_NULL_ARGUMENT - if the listener is null
  `SWTException` -
  - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
See Also:
  `TreeListener`, `removeTreeListener(org.eclipse.swt.events.TreeListener)`, `TreeEvent`

#### removeTreeListener

    public void removeTreeListener(TreeListener listener)

Removes the listener from the collection of listeners who will be notified when the receiver's items changes.

Parameters:
  `listener` - the listener which should no longer be notified
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
See Also:
  `TreeListener`, `addTreeListener(TreeListener)`

#### setItemCount

    public void setItemCount(int count)

Sets the number of items contained in the receiver.

Parameters:
  `count` - 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

#### 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 GridItem[] getItems()

Returns a (possibly empty) array of `GridItem`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

#### getItem

    public GridItem 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:
  `java.lang.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 GridItem getItem(Point point)

Returns the item at the given point in the receiver or null if no such item exists. The point is in the coordinate system of the receiver.

Parameters:
  `point` - the point used to locate the item
Returns:
  the item at the given point
Throws:
  `java.lang.IllegalArgumentException` -
  - ERROR_NULL_ARGUMENT - if the point is null
  `SWTException` -
  - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

#### indexOf

    public int indexOf(GridItem item)

Searches the receiver's list starting at the first item (index 0) until an item is found that is equal to the argument, and returns the index of that item. If no item is found, returns -1.

Parameters:
  `item` - the search item
Returns:
  the index of the item
Throws:
  `java.lang.IllegalArgumentException` -
  - ERROR_NULL_ARGUMENT - if the item is null
  `SWTException` -
  - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

#### getRootItemCount

    public int getRootItemCount()

Returns the number of root 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

#### getRootItems

    public GridItem[] getRootItems()

Returns a (possibly empty) array of `GridItem`s which are the root 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 root 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

#### getRootItem

    public GridItem getRootItem(int index)

TODO: JavaDoc

Parameters:
  `index` -
Returns:
  the root item

#### getNextVisibleItem

    public GridItem getNextVisibleItem(GridItem item)

Returns the next visible item in the table.

Parameters:
  `item` - item
Returns:
  next visible item or null
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

#### getPreviousVisibleItem

    public GridItem getPreviousVisibleItem(GridItem item)

Returns the previous visible item in the table. Passing null for the item will return the last visible item in the table.

Parameters:
  `item` - item or null
Returns:
  previous visible item or if item==null last visible item
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

#### getColumnCount

    public int getColumnCount()

Returns the number of columns contained in the receiver. If no `GridColumn`s were created by the programmer, this value is zero, despite the fact that visually, one column of items may be visible. This occurs when the programmer uses the table like a list, adding items but never creating a column.

Returns:
  the number of columns
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

#### getColumns

    public GridColumn[] getColumns()

Returns an array of `GridColumn`s which are the columns in the receiver. If no `GridColumn`s were created by the programmer, the array is empty, despite the fact that visually, one column of items may be visible. This occurs when the programmer uses the table like a list, adding items but never creating a column.

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

#### getColumn

    public GridColumn getColumn(int index)

Returns the column at the given, zero-relative index in the receiver. Throws an exception if the index is out of range. If no `GridColumn`s were created by the programmer, this method will throw `ERROR_INVALID_RANGE` despite the fact that a single column of data may be visible in the table. This occurs when the programmer uses the table like a list, adding items but never creating a column.

Parameters:
  `index` - the index of the column to return
Returns:
  the column at the given index
Throws:
  `java.lang.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

#### getColumn

    public GridColumn getColumn(Point point)

Returns the column at the given point in the receiver or null if no such column exists. The point is in the coordinate system of the receiver.

Parameters:
  `point` - the point used to locate the column
Returns:
  the column at the given point
Throws:
  `java.lang.IllegalArgumentException` -
  - ERROR_NULL_ARGUMENT - if the point is null
  `SWTException` -
  - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

#### indexOf

    public int indexOf(GridColumn column)

Searches the receiver's list starting at the first column (index 0) until a column is found that is equal to the argument, and returns the index of that column. If no column is found, returns -1.

Parameters:
  `column` - the search column
Returns:
  the index of the column
Throws:
  `java.lang.IllegalArgumentException` -
  - ERROR_NULL_ARGUMENT - if the column is null
  `SWTException` -
  - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

#### setColumnOrder

    public void setColumnOrder(int[] order)

Sets the order that the items in the receiver should be displayed in to the given argument which is described in terms of the zero-relative ordering of when the items were added.

Parameters:
  `order` - the new order to display the 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
  `java.lang.IllegalArgumentException` -
  - ERROR_NULL_ARGUMENT - if the item order is null
  - ERROR_INVALID_ARGUMENT - if the order is not the same length as the number of items, or if an item is listed twice, or if the order splits a column group

#### getColumnOrder

    public int[] getColumnOrder()

Returns an array of zero-relative integers that map the creation order of the receiver's items to the order in which they are currently being displayed.

Specifically, the indices of the returned array represent the current visual order of the items, and the contents of the array represent the creation order of the items.

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 current visual order of the receiver's 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

#### getNextVisibleColumn

    public GridColumn getNextVisibleColumn(GridColumn column)

Returns the next visible column in the table.

Parameters:
  `column` - column
Returns:
  next visible column or null
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

#### getPreviousVisibleColumn

    public GridColumn getPreviousVisibleColumn(GridColumn column)

Returns the previous visible column in the table.

Parameters:
  `column` - column
Returns:
  previous visible column or null
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

#### getColumnGroupCount

    public int getColumnGroupCount()

Returns the number of column groups contained in the receiver.

Returns:
  the number of column groups
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

#### getColumnGroups

    public GridColumnGroup[] getColumnGroups()

Returns an array of `GridColumnGroup`s which are the column groups 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 column groups 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

#### getColumnGroup

    public GridColumnGroup getColumnGroup(int index)

Returns the column group 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 column group to return
Returns:
  the column group at the given index
Throws:
  `java.lang.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

#### clear

    public void clear(int index,
                      boolean allChildren)

Clears the item at the given zero-relative index in the receiver. The text, icon and other attributes of the item are set to the default value. If the table was created with the `SWT.VIRTUAL` style, these attributes are requested again as needed.

Parameters:
  `index` - the index of the item to clear
  `allChildren` - `true` if all child items of the indexed item should be cleared recursively, and `false` otherwise
Throws:
  `java.lang.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
See Also:
  `SWT.VIRTUAL`, `SWT.SetData`

#### clear

    public void clear(int start,
                      int end,
                      boolean allChildren)

Clears the items in the receiver which are between the given zero-relative start and end indices (inclusive). The text, icon and other attributes of the items are set to their default values. If the table was created with the `SWT.VIRTUAL` style, these attributes are requested again as needed.

Parameters:
  `start` - the start index of the item to clear
  `end` - the end index of the item to clear
  `allChildren` - `true` if all child items of the range of items should be cleared recursively, and `false` otherwise
Throws:
  `java.lang.IllegalArgumentException` -
  - ERROR_INVALID_RANGE - if either the start or end are 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
See Also:
  `SWT.VIRTUAL`, `SWT.SetData`

#### clear

    public void clear(int[] indices,
                      boolean allChildren)

Clears the items at the given zero-relative indices in the receiver. The text, icon and other attributes of the items are set to their default values. If the table was created with the `SWT.VIRTUAL` style, these attributes are requested again as needed.

Parameters:
  `indices` - the array of indices of the items
  `allChildren` - `true` if all child items of the indexed items should be cleared recursively, and `false` otherwise
Throws:
  `java.lang.IllegalArgumentException` -
  - ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)
  - ERROR_NULL_ARGUMENT - if the indices array is null
  `SWTException` -
  - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
See Also:
  `SWT.VIRTUAL`, `SWT.SetData`

#### clearAll

    public void clearAll(boolean allChildren)

Clears all the items in the receiver. The text, icon and other attributes of the items are set to their default values. If the table was created with the `SWT.VIRTUAL` style, these attributes are requested again as needed.

Parameters:
  `allChildren` - `true` if all child items of each item should be cleared recursively, and `false` otherwise
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
See Also:
  `SWT.VIRTUAL`, `SWT.SetData`

#### setSelectionEnabled

    public void setSelectionEnabled(boolean selectionEnabled)

Enables selection highlighting if the argument is `true`.

Parameters:
  `selectionEnabled` - the selection enabled state
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

#### getSelectionEnabled

    public boolean getSelectionEnabled()

Returns `true` if selection is enabled, false otherwise.

Returns:
  the selection enabled state
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

#### getCellSelectionEnabled

    public boolean getCellSelectionEnabled()

Returns true if the cells are selectable in the reciever.

Returns:
  cell selection enablement status.
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
Since:
  3.13

#### setCellSelectionEnabled

    public void setCellSelectionEnabled(boolean cellSelection)

Sets whether cells are selectable in the receiver.

Parameters:
  `cellSelection` - the cellSelection to set
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
Since:
  3.13

#### isCellSelectionEnabled

    public boolean isCellSelectionEnabled()

Returns true if the cells are selectable in the reciever.

Returns:
  cell selection enablement status.
Since:
  3.13

#### select

    public void select(int index)

Selects the item at the given zero-relative index in the receiver. If the item at the index was already selected, it remains selected. Indices that are out of range are ignored.

If cell selection is enabled, selects all cells at the given index.

Parameters:
  `index` - the index of the item to select
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

#### select

    public void select(int start,
                       int end)

Selects the items in the range specified by the given zero-relative indices in the receiver. The range of indices is inclusive. The current selection is not cleared before the new items are selected.

If an item in the given range is not selected, it is selected. If an item in the given range was already selected, it remains selected. Indices that are out of range are ignored and no items will be selected if start is greater than end. If the receiver is single-select and there is more than one item in the given range, then all indices are ignored.

If cell selection is enabled, all cells within the given range are selected.

Parameters:
  `start` - the start of the range
  `end` - the end of the range
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
See Also:
  `setSelection(int,int)`

#### select

    public void select(int[] indices)

Selects the items at the given zero-relative indices in the receiver. The current selection is not cleared before the new items are selected.

If the item at a given index is not selected, it is selected. If the item at a given index was already selected, it remains selected. Indices that are out of range and duplicate indices are ignored. If the receiver is single-select and multiple indices are specified, then all indices are ignored.

If cell selection is enabled, all cells within the given indices are selected.

Parameters:
  `indices` - the array of indices for the items to select
Throws:
  `java.lang.IllegalArgumentException` -
  - ERROR_NULL_ARGUMENT - if the array of indices is null
  `SWTException` -
  - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
See Also:
  `setSelection(int[])`

#### selectAll

    public void selectAll()

Selects all of the items in the receiver.

If the receiver is single-select, do nothing. If cell selection is enabled, all cells are selected.

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

#### selectCell

    public void selectCell(Point cell)

Selects the given cell. Invalid cells are ignored.

Parameters:
  `cell` - point whose x value is a column index and y value is an item index
Throws:
  `java.lang.IllegalArgumentException` -
  - ERROR_NULL_ARGUMENT - if the item is null
  `SWTException` -
  - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
Since:
  3.13

#### selectCells

    public void selectCells(Point[] cells)

Selects the given cells. Invalid cells are ignored.

Parameters:
  `cells` - an arry of points whose x value is a column index and y value is an item index
Throws:
  `java.lang.IllegalArgumentException` -
  - ERROR_NULL_ARGUMENT - if the set of cells or an individual cell is null
  `SWTException` -
  - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
Since:
  3.13

#### selectAllCells

    public void selectAllCells()

Selects all cells 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
Since:
  3.13

#### selectColumn

    public void selectColumn(int col)

Selects all cells in the given column in the receiver.

Parameters:
  `col` -
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
Since:
  3.13

#### selectColumnGroup

    public void selectColumnGroup(int colGroup)

Selects all cells in the given column group in the receiver.

Parameters:
  `colGroup` - the column group
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
Since:
  3.13

#### selectColumnGroup

    public void selectColumnGroup(GridColumnGroup colGroup)

Selects all cells in the given column group in the receiver.

Parameters:
  `colGroup` - the column group
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
Since:
  3.13

#### deselect

    public void deselect(int index)

Deselects the item at the given zero-relative index in the receiver. If the item at the index was already deselected, it remains deselected. Indices that are out of range are ignored.

If cell selection is enabled, all cells in the specified item are deselected.

Parameters:
  `index` - the index of the item to deselect
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

#### deselect

    public void deselect(int start,
                         int end)

Deselects the items at the given zero-relative indices in the receiver. If the item at the given zero-relative index in the receiver is selected, it is deselected. If the item at the index was not selected, it remains deselected. The range of the indices is inclusive. Indices that are out of range are ignored.

If cell selection is enabled, all cells in the given range are deselected.

Parameters:
  `start` - the start index of the items to deselect
  `end` - the end index of the items to deselect
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

#### deselect

    public void deselect(int[] indices)

Deselects the items at the given zero-relative indices in the receiver. If the item at the given zero-relative index in the receiver is selected, it is deselected. If the item at the index was not selected, it remains deselected. Indices that are out of range and duplicate indices are ignored.

If cell selection is enabled, all cells in the given items are deselected.

Parameters:
  `indices` - the array of indices for the items to deselect
Throws:
  `java.lang.IllegalArgumentException` -
  - ERROR_NULL_ARGUMENT - if the set of indices is null
  `SWTException` -
  - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

#### deselectAll

    public void deselectAll()

Deselects all selected items in the receiver. If cell selection is enabled, all cells are deselected.

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

#### deselectCell

    public void deselectCell(Point cell)

Deselects the given cell in the receiver. If the given cell is already deselected it remains deselected. Invalid cells are ignored.

Parameters:
  `cell` - cell to deselect.
Throws:
  `java.lang.IllegalArgumentException` -
  - ERROR_NULL_ARGUMENT - if the cell is null
  `SWTException` -
  - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
Since:
  3.13

#### deselectCells

    public void deselectCells(Point[] cells)

Deselects the given cells. Invalid cells are ignored.

Parameters:
  `cells` - the cells to deselect.
Throws:
  `java.lang.IllegalArgumentException` -
  - ERROR_NULL_ARGUMENT - if the set of cells or any cell is null
  `SWTException` -
  - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
Since:
  3.13

#### deselectAllCells

    public void deselectAllCells()

Deselects all selected cells 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
Since:
  3.13

#### setSelection

    public void setSelection(int index)

Selects the item at the given zero-relative index in the receiver. The current selection is first cleared, then the new item is selected.

If cell selection is enabled, all cells within the item at the given index are selected.

Parameters:
  `index` - the index of the item to select
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

#### setSelection

    public void setSelection(int start,
                             int end)

Selects the items in the range specified by the given zero-relative indices in the receiver. The range of indices is inclusive. The current selection is cleared before the new items are selected.

Indices that are out of range are ignored and no items will be selected if start is greater than end. If the receiver is single-select and there is more than one item in the given range, then all indices are ignored.

If cell selection is enabled, all cells within the given range are selected.

Parameters:
  `start` - the start index of the items to select
  `end` - the end index of the items to select
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
See Also:
  `deselectAll()`, `select(int,int)`

#### setSelection

    public void setSelection(int[] indices)

Selects the items at the given zero-relative indices in the receiver. The current selection is cleared before the new items are selected.

Indices that are out of range and duplicate indices are ignored. If the receiver is single-select and multiple indices are specified, then all indices are ignored.

If cell selection is enabled, all cells within the given indices are selected.

Parameters:
  `indices` - the indices of the items to select
Throws:
  `java.lang.IllegalArgumentException` -
  - ERROR_NULL_ARGUMENT - if the array of indices is null
  `SWTException` -
  - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
See Also:
  `deselectAll()`, `select(int[])`

#### setSelection

    public void setSelection(GridItem[] items)

Sets the receiver's selection to be the given array of items. The current selection is cleared before the new items are selected.

Items that are not in the receiver are ignored. If the receiver is single-select and multiple items are specified, then all items are ignored. If cell selection is enabled, all cells within the given items are selected.

Parameters:
  `items` - the array of items
Throws:
  `java.lang.IllegalArgumentException` -
  - ERROR_NULL_ARGUMENT - if the array of items is null
  - ERROR_INVALID_ARGUMENT - if one of the items has been disposed
  `SWTException` -
  - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
See Also:
  `deselectAll()`, `select(int[])`, `setSelection(int[])`

#### getSelection

    public GridItem[] getSelection()

Returns a array of `GridItem`s that are currently selected in the receiver. The order of the items is unspecified. An empty array indicates that no items are selected.

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

If cell selection is enabled, any items which contain at least one selected cell are returned.

Returns:
  an array representing the selection
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

#### getSelectionCount

    public int getSelectionCount()

Returns the number of selected items contained in the receiver. If cell selection is enabled, the number of items with at least one selected cell are returned.

Returns:
  the number of selected 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

#### getCellSelectionCount

    public int getCellSelectionCount()

Returns the number of selected cells contained in the receiver.

Returns:
  the number of selected cells
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
Since:
  3.13

#### setCellSelection

    public void setCellSelection(Point cell)

Selects the selection to the given cell. The existing selection is cleared before selecting the given cell.

Parameters:
  `cell` - point whose x value is a column index and y value is an item index
Throws:
  `java.lang.IllegalArgumentException` -
  - ERROR_NULL_ARGUMENT - if the item is null
  - ERROR_INVALID_ARGUMENT - if the cell is invalid
  `SWTException` -
  - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
Since:
  3.13

#### setCellSelection

    public void setCellSelection(Point[] cells)

Selects the selection to the given set of cell. The existing selection is cleared before selecting the given cells.

Parameters:
  `cells` - point array whose x values is a column index and y value is an item index
Throws:
  `java.lang.IllegalArgumentException` -
  - ERROR_NULL_ARGUMENT - if the cell array or an individual cell is null
  - ERROR_INVALID_ARGUMENT - if the a cell is invalid
  `SWTException` -
  - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
Since:
  3.13

#### getCellSelection

    public Point[] getCellSelection()

Returns an array of cells that are currently selected in the receiver. The order of the items is unspecified. An empty array indicates that no items are selected.

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

Returns:
  an array representing the cell selection
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
Since:
  3.13

#### getSelectionIndex

    public int getSelectionIndex()

Returns the zero-relative index of the item which is currently selected in the receiver, or -1 if no item is selected. If cell selection is enabled, returns the index of first item that contains at least one selected cell.

Returns:
  the index of the selected item
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

#### getSelectionIndices

    public int[] getSelectionIndices()

Returns the zero-relative indices of the items which are currently selected in the receiver. The order of the indices is unspecified. The array is empty if no items are selected.

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

If cell selection is enabled, returns the indices of any items which contain at least one selected cell.

Returns:
  the array of indices of the selected 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

#### isSelected

    public boolean isSelected(int index)

Returns `true` if the item is selected, and `false` otherwise. Indices out of range are ignored. If cell selection is enabled, returns true if the item at the given index contains at least one selected cell.

Parameters:
  `index` - the index of the item
Returns:
  the visibility state of the item at the index
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

#### isSelected

    public boolean isSelected(GridItem item)

Returns true if the given item is selected. If cell selection is enabled, returns true if the given item contains at least one selected cell.

Parameters:
  `item` - item
Returns:
  true if the item is selected.
Throws:
  `java.lang.IllegalArgumentException` -
  - ERROR_NULL_ARGUMENT - if the item is null
  `SWTException` -
  - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

#### isCellSelected

    public boolean isCellSelected(Point cell)

Returns true if the given cell is selected.

Parameters:
  `cell` - cell
Returns:
  true if the cell is selected.
Throws:
  `java.lang.IllegalArgumentException` -
  - ERROR_NULL_ARGUMENT - if the cell is null
  `SWTException` -
  - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
Since:
  3.13

#### getCell

    public Point getCell(Point point)

Returns the cell at the given point in the receiver or null if no such cell exists. The point is in the coordinate system of the receiver.

Parameters:
  `point` - the point used to locate the cell
Returns:
  the cell at the given point
Throws:
  `java.lang.IllegalArgumentException` -
  - ERROR_NULL_ARGUMENT - if the point is null
  `SWTException` -
  - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
Since:
  3.13

#### remove

    public void remove(int index)

Removes the item from the receiver at the given zero-relative index.

Parameters:
  `index` - the index for the item
Throws:
  `java.lang.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

#### remove

    public void remove(int start,
                       int end)

Removes the items from the receiver which are between the given zero-relative start and end indices (inclusive).

Parameters:
  `start` - the start of the range
  `end` - the end of the range
Throws:
  `java.lang.IllegalArgumentException` -
  - ERROR_INVALID_RANGE - if either the start or end are 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

#### remove

    public void remove(int[] indices)

Removes the items from the receiver's list at the given zero-relative indices.

Parameters:
  `indices` - the array of indices of the items
Throws:
  `java.lang.IllegalArgumentException` -
  - ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)
  - ERROR_NULL_ARGUMENT - if the indices array is null
  `SWTException` -
  - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

#### removeAll

    public void removeAll()

Removes all of the items from 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

#### setHeaderVisible

    public void setHeaderVisible(boolean show)

Marks the receiver's header as visible if the argument is `true`, and marks it invisible otherwise.

Parameters:
  `show` - the new visibility state
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

#### getHeaderVisible

    public boolean getHeaderVisible()

Returns `true` if the receiver's header is visible, and `false` otherwise.

Returns:
  the receiver's header's visibility state
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

#### getHeaderHeight

    public int getHeaderHeight()

Returns the height of the column headers. If this table has column groups, the returned value includes the height of group headers.

Returns:
  height of the column header row
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

#### setFooterVisible

    public void setFooterVisible(boolean show)

Marks the receiver's footer as visible if the argument is `true`, and marks it invisible otherwise.

Parameters:
  `show` - the new visibility state
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

#### getFooterVisible

    public boolean getFooterVisible()

Returns `true` if the receiver's footer is visible, and `false` otherwise

Returns:
  the receiver's footer's visibility state
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

#### getFooterHeight

    public int getFooterHeight()

Returns the height of the column footers.

Returns:
  height of the column footer row
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

#### getGroupHeaderHeight

    public int getGroupHeaderHeight()

Returns the height of the column group headers.

Returns:
  height of column group headers
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

#### setLinesVisible

    public void setLinesVisible(boolean linesVisible)

Sets the line visibility.

Parameters:
  `linesVisible` - The linesVisible to set.
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

#### getLinesVisible

    public boolean getLinesVisible()

Returns true if the lines are visible.

Returns:
  Returns the linesVisible.
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

#### setFocusItem

    public void setFocusItem(GridItem item)

Sets the focused item to the given item.

Parameters:
  `item` - item to focus.
Throws:
  `java.lang.IllegalArgumentException` -
  - ERROR_INVALID_ARGUMENT - if item is disposed
  `SWTException` -
  - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

#### getFocusItem

    public GridItem getFocusItem()

Returns the current item in focus.

Returns:
  item in focus or `null`.
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

#### setFocusColumn

    public void setFocusColumn(GridColumn column)

Sets the focused column to the given column. Column focus is only applicable when cell selection is enabled.

Parameters:
  `column` - column to focus.
Throws:
  `java.lang.IllegalArgumentException` -
  - ERROR_INVALID_ARGUMENT - if item is disposed
  `SWTException` -
  - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
Since:
  3.13

#### getFocusColumn

    public GridColumn getFocusColumn()

Returns the current column in focus. Column focus is only applicable when cell selection is enabled.

Returns:
  column in focus or `null`.
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
Since:
  3.13

#### getFocusCell

    public Point getFocusCell()

Returns the current cell in focus. If cell selection is disabled, this method returns null.

Returns:
  cell in focus or `null`. x represents the column and y the row the cell is in
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
Since:
  3.13

#### setItemHeight

    public void setItemHeight(int height)

Sets the default height for this `Grid`'s items. When this method is called, all existing items are resized to the specified height and items created afterwards will be initially sized to this height.

As long as no default height was set by the client through this method, the preferred height of the first item in this `Grid` is used as a default for all items (and is returned by `getItemHeight()`).

Parameters:
  `height` - default height in pixels
Throws:
  `java.lang.IllegalArgumentException` -
  - ERROR_INVALID_ARGUMENT - if the height is < 1
  `SWTException` -
  - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
See Also:
  `GridItem.getHeight()`

#### getItemHeight

    public int getItemHeight()

Returns the default height of the items in this `Grid`. See `setItemHeight(int)` for details.

Returns:
  default height 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
See Also:
  `setItemHeight(int)`

#### setFont

    public void setFont(Font font)

Description copied from class: `Control`
Sets the font that the receiver will use to paint textual information to the font specified by the argument, or to the default font for that kind of control if the argument is null.

Overrides:
  `setFont` in class `Control`
Parameters:
  `font` - the new font (or null)

#### setTopIndex

    public void setTopIndex(int index)

Sets the zero-relative index of the item which is currently at the top of the receiver. This index can change when items are scrolled or new items are added and removed.

Parameters:
  `index` - the index of the top item
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

#### getTopIndex

    public int getTopIndex()

Returns the zero-relative index of the item which is currently at the top of the receiver. This index can change when items are scrolled or new items are added or removed.

Returns:
  the index of the top item
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

#### showItem

    public void showItem(GridItem item)

Shows the item. If the item is already showing in the receiver, this method simply returns. Otherwise, the items are scrolled until the item is visible.

Parameters:
  `item` - the item to be shown
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
  - ERROR_INVALID_ARGUMENT - if 'item' is not contained in the receiver

#### showColumn

    public void showColumn(GridColumn column)

Shows the column. If the column is already showing in the receiver, this method simply returns. Otherwise, the columns are scrolled until the column is visible.

Parameters:
  `column` - the column to be shown
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

#### showSelection

    public void showSelection()

Shows the selection. If the selection is already showing in the receiver, this method simply returns. Otherwise, the items are scrolled until the selection is visible.

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

#### setAutoHeight

    public void setAutoHeight(boolean autoHeight)

Sets the value of the auto-height feature. When enabled, this feature resizes the height of rows to reflect the content of cells with word-wrapping enabled. Cell word-wrapping is enabled via the GridColumn.setWordWrap(boolean) method. If column headers have word-wrapping enabled, this feature will also resize the height of the column headers as necessary.

Parameters:
  `autoHeight` - Set to true to enable this feature, false (default) otherwise.

#### isAutoHeight

    public boolean isAutoHeight()

Returns the value of the auto-height feature, which resizes row heights and column header heights based on word-wrapped content.

Returns:
  Returns whether or not the auto-height feature is enabled.
See Also:
  `setAutoHeight(boolean)`

#### recalculateHeader

    public void recalculateHeader()

Recalculate the height of the header

Since:
  3.4

#### getAdapter

    public <T> T getAdapter(java.lang.Class<T> adapter)

Description copied from class: `Widget`
Implementation of the `Adaptable` interface.

IMPORTANT: This method is not part of the RWT public API. It is marked public only so that it can be shared within the packages provided by RWT. It should never be accessed from application code.

Specified by:
  `getAdapter` in interface `Adaptable`
Overrides:
  `getAdapter` in class `Composite`
Parameters:
  `adapter` - the lookup class
Returns:
  an object that can be cast to the given class or `null` if there is no adapter associated with the given class.

#### setData

    public void setData(java.lang.String key,
                        java.lang.Object value)

Description copied from class: `Widget`
Sets the application defined property of the receiver with the specified name to the given value.

Applications may associate arbitrary objects with the receiver in this fashion. If the objects stored in the properties need to be notified when the widget is disposed of, it is the application's responsibility to hook the Dispose event on the widget and do so.

Overrides:
  `setData` in class `Control`
Parameters:
  `key` - the name of the property
  `value` - the new value for the property
See Also:
  `Widget.getData(String)`

#### getHorizontalScrollBarProxy

    protected IScrollBarProxy getHorizontalScrollBarProxy()

#### getVerticalScrollBarProxy

    protected IScrollBarProxy getVerticalScrollBarProxy()

Copyright (c) EclipseSource and others 2002, 2020. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0