Class GridTableViewer
This class is not intended to be subclassed outside the viewer framework. It is designed to be instantiated with a pre-existing Grid control and configured with a domain-specific content provider, label provider, element filter (optional), and element sorter (optional).
 Content providers for grid table viewers must not implement the 
 ITreeContentProvider interface. Instead a GridTreeViewer should be used.
 
- 
Constructor SummaryConstructorsConstructorDescriptionGridTableViewer(Grid grid) Creates a grid viewer on the given grid control.GridTableViewer(Composite parent) Creates a grid viewer on a newly-created grid control under the given parent.GridTableViewer(Composite parent, int style) Creates a grid viewer on a newly-created grid control under the given parent.
- 
Method SummaryModifier and TypeMethodDescriptionprotected ColumnViewerEditorprotected voiddoClear(int index) protected voidprotected voidprotected WidgetdoGetColumn(int index) protected intprotected ItemdoGetItem(int index) protected intprotected Item[]protected Item[]protected int[]protected intprotected voiddoRemove(int[] indices) protected voiddoRemove(int start, int end) protected voidprotected voiddoResetItem(Item item) protected voiddoSelect(int[] indices) protected voiddoSetItemCount(int count) protected voiddoSetSelection(int[] indices) protected voiddoSetSelection(Item[] items) protected voiddoShowItem(Item item) protected voidprotected voiddoUpdateItem(Widget widget, Object element, boolean fullMap) voideditElement(Object element, int column) booleangetGrid()Returns the underlying Grid Control.protected ItemISelectionprotected ViewerRowgetViewerRowFromItem(Widget item) protected voidhandleDispose(DisposeEvent event) (non-Javadoc)protected ViewerRowinternalCreateNewRowPart(int style, int rowIndex) voidrefresh()voidrefreshRowHeaders(Object element) Refresh row headers onlyvoidsetAutoPreferredHeight(boolean autoPreferredHeight) When set to true, this grid viewer will ensure that each of the grid's items is always automatically sized to its preferred height.voidsetRowHeaderLabelProvider(CellLabelProvider rowHeaderLabelProvider) Label provider used by calculate the row header textprotected voidsetSelectionToWidget(ISelection selection, boolean reveal) 
- 
Constructor Details- 
GridTableViewerCreates a grid viewer on a newly-created grid control under the given parent. The grid control is created using the SWT style bitsMULTI, H_SCROLL, V_SCROLL,andBORDER. The viewer has no input, no content provider, a default label provider, no sorter, and no filters.- Parameters:
- parent- the parent control
 
- 
GridTableViewerCreates a grid viewer on a newly-created grid control under the given parent. The grid control is created using the given SWT style bits. The viewer has no input, no content provider, a default label provider, no sorter, and no filters.- Parameters:
- parent- the parent control
- style- the SWT style bits used to create the grid.
 
- 
GridTableViewerCreates a grid viewer on the given grid control. The viewer has no input, no content provider, a default label provider, no sorter, and no filters.- Parameters:
- grid- the grid control
 
 
- 
- 
Method Details- 
getGridReturns the underlying Grid Control.- Returns:
- grid control.
 
- 
internalCreateNewRowPartprotected ViewerRow internalCreateNewRowPart(int style, int rowIndex) 
- 
createViewerEditorprotected ColumnViewerEditor createViewerEditor()
- 
doClearprotected void doClear(int index) 
- 
doClearAllprotected void doClearAll()
- 
refreshpublic void refresh()- See Also:
- 
- org.eclipse.jface.viewers.StructuredViewer#refresh()
 
 
- 
doSetItemCountprotected void doSetItemCount(int count) 
- 
doDeselectAllprotected void doDeselectAll()
- 
doGetColumn
- 
doGetColumnCountprotected int doGetColumnCount()
- 
doGetItem
- 
doGetItemCountprotected int doGetItemCount()
- 
doGetItems
- 
doGetSelection
- 
doGetSelectionIndicesprotected int[] doGetSelectionIndices()
- 
doIndexOf
- 
doRemoveprotected void doRemove(int[] indices) 
- 
doRemoveprotected void doRemove(int start, int end) 
- 
doRemoveAllprotected void doRemoveAll()
- 
handleDispose(non-Javadoc)- See Also:
- 
- fix crossed reference for GC
 
 
- 
doSetSelection
- 
doSetSelectionprotected void doSetSelection(int[] indices) 
- 
doShowItem
- 
doShowSelectionprotected void doShowSelection()
- 
getItemAt
- 
getControl
- 
getViewerRowFromItem
- 
doResetItem
- 
doSelectprotected void doSelect(int[] indices) 
- 
setAutoPreferredHeightpublic void setAutoPreferredHeight(boolean autoPreferredHeight) When set to true, this grid viewer will ensure that each of the grid's items is always automatically sized to its preferred height. The default is false.Since this mechanism usually leads to a grid with rows of different heights and thus to a grid with decreased performance, it should only be applied if that is intended. To set the height of all items to a specific value, use Grid.setItemHeight(int)instead.When a column with activated word wrapping is resized by dragging the column resizer, the items are only auto-resized properly if you use GridViewerColumnto create the columns.When this method is called, existing rows are not resized to their preferred height. Therefore it is suggested that this method be called before rows are populated (i.e. before setInput). - Parameters:
- autoPreferredHeight-
 
- 
getAutoPreferredHeightpublic boolean getAutoPreferredHeight()- Returns:
- true if this grid viewer sizes its rows to their preferred height
- See Also:
 
- 
doUpdateItem
- 
setRowHeaderLabelProviderpublic void setRowHeaderLabelProvider(CellLabelProvider rowHeaderLabelProvider) Label provider used by calculate the row header text- Parameters:
- rowHeaderLabelProvider- the provider
 
- 
refreshRowHeadersRefresh row headers only- Parameters:
- element- the element to start or- nullif all rows should be refreshed
 
- 
editElement
- 
setSelectionToWidgetprotected void setSelectionToWidget(ISelection selection, boolean reveal) 
- 
getSelectionpublic ISelection getSelection()
 
-