public class GridTableViewer
extends org.eclipse.jface.viewers.AbstractTableViewer
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 and Description |
---|
GridTableViewer(org.eclipse.swt.widgets.Composite parent)
Creates a grid viewer on a newly-created grid control under the given parent.
|
GridTableViewer(org.eclipse.swt.widgets.Composite parent,
int style)
Creates a grid viewer on a newly-created grid control under the given parent.
|
GridTableViewer(DataVisualizer dataVisualizer,
org.eclipse.swt.widgets.Composite parent)
Creates a grid viewer on a newly-created grid control under the given parent.
|
GridTableViewer(DataVisualizer dataVisualizer,
org.eclipse.swt.widgets.Composite parent,
int style)
Creates a grid viewer on a newly-created grid control under the given parent.
|
GridTableViewer(Grid grid)
Creates a grid viewer on the given grid control.
|
Modifier and Type | Method and Description |
---|---|
protected org.eclipse.jface.viewers.ColumnViewerEditor |
createViewerEditor() |
protected void |
doClear(int index) |
protected void |
doClearAll() |
protected void |
doDeselectAll() |
protected org.eclipse.swt.widgets.Widget |
doGetColumn(int index) |
protected int |
doGetColumnCount() |
protected org.eclipse.swt.widgets.Item |
doGetItem(int index) |
protected int |
doGetItemCount() |
protected org.eclipse.swt.widgets.Item[] |
doGetItems() |
protected org.eclipse.swt.widgets.Item[] |
doGetSelection() |
protected int[] |
doGetSelectionIndices() |
protected int |
doIndexOf(org.eclipse.swt.widgets.Item item) |
protected void |
doRemove(int[] indices) |
protected void |
doRemove(int start,
int end) |
protected void |
doRemoveAll() |
protected void |
doResetItem(org.eclipse.swt.widgets.Item item) |
protected void |
doSelect(int[] indices) |
protected void |
doSetItemCount(int count) |
protected void |
doSetSelection(int[] indices) |
protected void |
doSetSelection(org.eclipse.swt.widgets.Item[] items) |
protected void |
doShowItem(org.eclipse.swt.widgets.Item item) |
protected void |
doShowSelection() |
protected void |
doUpdateItem(org.eclipse.swt.widgets.Widget widget,
java.lang.Object element,
boolean fullMap) |
void |
editElement(java.lang.Object element,
int column) |
boolean |
getAutoPreferredHeight() |
org.eclipse.swt.widgets.Control |
getControl() |
Grid |
getGrid()
Returns the underlying Grid Control.
|
protected org.eclipse.swt.widgets.Item |
getItemAt(org.eclipse.swt.graphics.Point point) |
org.eclipse.jface.viewers.ISelection |
getSelection() |
protected org.eclipse.jface.viewers.ViewerRow |
getViewerRowFromItem(org.eclipse.swt.widgets.Widget item) |
protected void |
handleDispose(org.eclipse.swt.events.DisposeEvent event)
(non-Javadoc)
|
protected org.eclipse.jface.viewers.ViewerRow |
internalCreateNewRowPart(int style,
int rowIndex) |
void |
refresh() |
void |
refreshRowHeaders(java.lang.Object element)
Refresh row headers only
|
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.
|
void |
setRowHeaderLabelProvider(org.eclipse.jface.viewers.CellLabelProvider rowHeaderLabelProvider)
Label provider used by calculate the row header text
|
protected void |
setSelectionToWidget(org.eclipse.jface.viewers.ISelection selection,
boolean reveal) |
add, add, assertContentProviderType, clear, doFindInputItem, doFindItem, getColumnViewerOwner, getElementAt, getLabelProvider, getRawChildren, getSelectionFromWidget, hookControl, indexForElement, inputChanged, insert, internalRefresh, internalRefresh, remove, remove, replace, reveal, setContentProvider, setItemCount, setSelectionToWidget
applyEditorValue, cancelEditing, checkBusy, getCell, getCellEditors, getCellModifier, getColumnProperties, getColumnViewerEditor, getItem, getLabelProvider, getViewerRow, hookEditingSupport, isBusy, isCellEditorActive, refresh, refresh, setBusy, setCellEditors, setCellModifier, setColumnProperties, setColumnViewerEditor, setLabelProvider, triggerEditorActivationEvent, update
addDoubleClickListener, addDragSupport, addDropSupport, addFilter, addOpenListener, addPostSelectionChangedListener, assertElementsNotNull, associate, buildLabel, disassociate, equals, filter, findItem, findItems, fireDoubleClick, fireOpen, firePostSelectionChanged, getColorAndFontCollector, getComparator, getComparer, getFilteredChildren, getFilters, getRoot, getSortedChildren, getSorter, getStructuredSelection, handleDoubleSelect, handleInvalidSelection, handleLabelProviderChanged, handleOpen, handlePostSelect, handleSelect, hasFilters, internalUpdate, mapElement, needsRefilter, preservingSelection, refresh, refreshItem, removeDoubleClickListener, removeFilter, removeOpenListener, removePostSelectionChangedListener, resetFilters, setComparator, setComparer, setFilters, setInput, setSelection, setSorter, setUseHashlookup, testFindItem, testFindItems, unmapAllElements, unmapElement, unmapElement, update, updateItem, updateSelection, usingElementMap
getContentProvider, getInput, labelProviderChanged
addHelpListener, addSelectionChangedListener, fireHelpRequested, fireSelectionChanged, getData, handleHelpRequest, removeHelpListener, removeSelectionChangedListener, scrollDown, scrollUp, setData, setSelection
public GridTableViewer(org.eclipse.swt.widgets.Composite parent)
MULTI, H_SCROLL, V_SCROLL,
and BORDER
. The viewer
has no input, no content provider, a default label provider, no sorter, and
no filters.parent
- the parent controlpublic GridTableViewer(DataVisualizer dataVisualizer, org.eclipse.swt.widgets.Composite parent, int style)
dataVisualizer
- parent
- the parent controlstyle
- the SWT style bits used to create the grid.public GridTableViewer(DataVisualizer dataVisualizer, org.eclipse.swt.widgets.Composite parent)
MULTI, H_SCROLL, V_SCROLL,
and BORDER
. The viewer
has no input, no content provider, a default label provider, no sorter, and
no filters.dataVisualizer
- parent
- the parent controlpublic GridTableViewer(org.eclipse.swt.widgets.Composite parent, int style)
parent
- the parent controlstyle
- the SWT style bits used to create the grid.public GridTableViewer(Grid grid)
grid
- the grid controlpublic Grid getGrid()
protected org.eclipse.jface.viewers.ViewerRow internalCreateNewRowPart(int style, int rowIndex)
internalCreateNewRowPart
in class org.eclipse.jface.viewers.AbstractTableViewer
protected org.eclipse.jface.viewers.ColumnViewerEditor createViewerEditor()
createViewerEditor
in class org.eclipse.jface.viewers.ColumnViewer
protected void doClear(int index)
doClear
in class org.eclipse.jface.viewers.AbstractTableViewer
protected void doClearAll()
doClearAll
in class org.eclipse.jface.viewers.AbstractTableViewer
public void refresh()
refresh
in class org.eclipse.jface.viewers.StructuredViewer
StructuredViewer.refresh()
protected void doSetItemCount(int count)
doSetItemCount
in class org.eclipse.jface.viewers.AbstractTableViewer
protected void doDeselectAll()
doDeselectAll
in class org.eclipse.jface.viewers.AbstractTableViewer
protected org.eclipse.swt.widgets.Widget doGetColumn(int index)
doGetColumn
in class org.eclipse.jface.viewers.AbstractTableViewer
protected int doGetColumnCount()
doGetColumnCount
in class org.eclipse.jface.viewers.ColumnViewer
protected org.eclipse.swt.widgets.Item doGetItem(int index)
doGetItem
in class org.eclipse.jface.viewers.AbstractTableViewer
protected int doGetItemCount()
doGetItemCount
in class org.eclipse.jface.viewers.AbstractTableViewer
protected org.eclipse.swt.widgets.Item[] doGetItems()
doGetItems
in class org.eclipse.jface.viewers.AbstractTableViewer
protected org.eclipse.swt.widgets.Item[] doGetSelection()
doGetSelection
in class org.eclipse.jface.viewers.AbstractTableViewer
protected int[] doGetSelectionIndices()
doGetSelectionIndices
in class org.eclipse.jface.viewers.AbstractTableViewer
protected int doIndexOf(org.eclipse.swt.widgets.Item item)
doIndexOf
in class org.eclipse.jface.viewers.AbstractTableViewer
protected void doRemove(int[] indices)
doRemove
in class org.eclipse.jface.viewers.AbstractTableViewer
protected void doRemove(int start, int end)
doRemove
in class org.eclipse.jface.viewers.AbstractTableViewer
protected void doRemoveAll()
doRemoveAll
in class org.eclipse.jface.viewers.AbstractTableViewer
protected void handleDispose(org.eclipse.swt.events.DisposeEvent event)
handleDispose
in class org.eclipse.jface.viewers.AbstractTableViewer
fix crossed reference for GC
protected void doSetSelection(org.eclipse.swt.widgets.Item[] items)
doSetSelection
in class org.eclipse.jface.viewers.AbstractTableViewer
protected void doSetSelection(int[] indices)
doSetSelection
in class org.eclipse.jface.viewers.AbstractTableViewer
protected void doShowItem(org.eclipse.swt.widgets.Item item)
doShowItem
in class org.eclipse.jface.viewers.AbstractTableViewer
protected void doShowSelection()
doShowSelection
in class org.eclipse.jface.viewers.AbstractTableViewer
protected org.eclipse.swt.widgets.Item getItemAt(org.eclipse.swt.graphics.Point point)
getItemAt
in class org.eclipse.jface.viewers.ColumnViewer
public org.eclipse.swt.widgets.Control getControl()
getControl
in class org.eclipse.jface.viewers.Viewer
protected org.eclipse.jface.viewers.ViewerRow getViewerRowFromItem(org.eclipse.swt.widgets.Widget item)
getViewerRowFromItem
in class org.eclipse.jface.viewers.ColumnViewer
protected void doResetItem(org.eclipse.swt.widgets.Item item)
doResetItem
in class org.eclipse.jface.viewers.AbstractTableViewer
protected void doSelect(int[] indices)
doSelect
in class org.eclipse.jface.viewers.AbstractTableViewer
public void setAutoPreferredHeight(boolean autoPreferredHeight)
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
GridViewerColumn
to 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).
autoPreferredHeight
- public boolean getAutoPreferredHeight()
setAutoPreferredHeight(boolean)
protected void doUpdateItem(org.eclipse.swt.widgets.Widget widget, java.lang.Object element, boolean fullMap)
doUpdateItem
in class org.eclipse.jface.viewers.AbstractTableViewer
public void setRowHeaderLabelProvider(org.eclipse.jface.viewers.CellLabelProvider rowHeaderLabelProvider)
rowHeaderLabelProvider
- the providerpublic void refreshRowHeaders(java.lang.Object element)
element
- the element to start or null
if all rows should be
refreshedpublic void editElement(java.lang.Object element, int column)
editElement
in class org.eclipse.jface.viewers.ColumnViewer
protected void setSelectionToWidget(org.eclipse.jface.viewers.ISelection selection, boolean reveal)
setSelectionToWidget
in class org.eclipse.jface.viewers.StructuredViewer
public org.eclipse.jface.viewers.ISelection getSelection()
getSelection
in interface org.eclipse.jface.viewers.ISelectionProvider
getSelection
in class org.eclipse.jface.viewers.StructuredViewer