public class GridTreeViewer
extends org.eclipse.jface.viewers.AbstractTreeViewer
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 tree viewers must implement the
ITreeContentProvider
interface.
The current implementation does not support lazy content providers.
Constructor | Description |
---|---|
GridTreeViewer(Grid grid) |
Creates a grid tree viewer on the given grid control.
|
GridTreeViewer(org.eclipse.swt.widgets.Composite parent) |
Creates a grid tree viewer on a newly-created grid control under the given
parent.
|
GridTreeViewer(org.eclipse.swt.widgets.Composite parent,
int style) |
Creates a grid tree viewer on a newly-created grid control under the given
parent.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
getAutoPreferredHeight() |
|
org.eclipse.swt.widgets.Control |
getControl() |
|
Grid |
getGrid() |
Returns the underlying
Grid Control. |
void |
remove(java.lang.Object parentOrTreePath,
int index) |
Removes the element at the specified index of the parent.
|
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
|
add, add, addTreeListener, collapseAll, collapseToLevel, expandAll, expandAll, expandToLevel, expandToLevel, expandToLevel, expandToLevel, getAutoExpandLevel, getChildren, getExpandedElements, getExpandedState, getExpandedTreePaths, getSelection, getStructuredSelection, getVisibleExpandedElements, insert, isExpandable, remove, remove, remove, removeTreeListener, reveal, scrollDown, scrollUp, setAutoExpandLevel, setContentProvider, setExpandedElements, setExpandedState, setExpandedTreePaths, setExpandPreCheckFilters
applyEditorValue, cancelEditing, editElement, getCell, getCellEditors, getCellModifier, getColumnProperties, getColumnViewerEditor, getLabelProvider, isBusy, isCellEditorActive, refresh, refresh, setCellEditors, setCellModifier, setColumnProperties, setColumnViewerEditor, setLabelProvider, update
getContentProvider, getInput, getLabelProvider
addSelectionChangedListener, removeSelectionChangedListener, setSelection
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addDoubleClickListener, addDragSupport, addDropSupport, addFilter, addOpenListener, addPostSelectionChangedListener, getComparator, getComparer, getFilters, getSorter, refresh, refresh, removeDoubleClickListener, removeFilter, removeOpenListener, removePostSelectionChangedListener, resetFilters, setComparator, setComparer, setFilters, setInput, setSelection, setSorter, setUseHashlookup, testFindItem, testFindItems, update
public GridTreeViewer(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 GridTreeViewer(org.eclipse.swt.widgets.Composite parent, int style)
parent
- the parent controlstyle
- the SWT style bits used to create the grid.public GridTreeViewer(Grid grid)
grid
- the grid controlpublic org.eclipse.swt.widgets.Control getControl()
getControl
in class org.eclipse.jface.viewers.Viewer
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).
public boolean getAutoPreferredHeight()
setAutoPreferredHeight(boolean)
public void remove(java.lang.Object parentOrTreePath, int index)
parentOrTreePath
- the parent element, the input element, or a tree path to the parent elementindex
- child indexpublic void setRowHeaderLabelProvider(org.eclipse.jface.viewers.CellLabelProvider rowHeaderLabelProvider)
rowHeaderLabelProvider
- the provider