| java.lang.Object org.eclipse.jface.viewers.Viewer org.eclipse.jface.viewers.ContentViewer org.eclipse.jface.viewers.StructuredViewer org.eclipse.jface.viewers.ColumnViewer org.eclipse.jface.viewers.AbstractTableViewer org.eclipse.jface.viewers.TableViewer
All known Subclasses: org.eclipse.jface.viewers.CheckboxTableViewer,
TableViewer | public class TableViewer extends AbstractTableViewer (Code) | | A concrete viewer based on a SWT Table control.
This class is not intended to be subclassed outside the viewer framework. It
is designed to be instantiated with a pre-existing SWT table control and
configured with a domain-specific content provider, table label provider,
element filter (optional), and element sorter (optional).
Label providers for table viewers must implement either the
ITableLabelProvider or the ILabelProvider
interface (see TableViewer.setLabelProvider for more details).
As of 3.1 the TableViewer now supports the SWT.VIRTUAL flag. If the
underlying table is SWT.VIRTUAL, the content provider may implement
ILazyContentProvider instead of
IStructuredContentProvider .
Note that in this case, the viewer does not support sorting or filtering.
Also note that in this case, the Widget based APIs may return null if the
element is not specified or not created yet.
Users of SWT.VIRTUAL should also avoid using getItems() from the Table within
the TreeViewer as this does not necessarily generate a callback for the
TreeViewer to populate the items. It also has the side effect of creating all
of the items thereby eliminating the performance improvements of SWT.VIRTUAL.
See Also: SWT.VIRTUAL See Also: TableViewer.doFindItem(Object) See Also: TableViewer.internalRefresh(Object,boolean) |
Constructor Summary | |
public | TableViewer(Composite parent) Creates a table viewer on a newly-created table control under the given
parent. | public | TableViewer(Composite parent, int style) Creates a table viewer on a newly-created table control under the given
parent. | public | TableViewer(Table table) Creates a table viewer on the given table control. |
TableViewer | public TableViewer(Composite parent)(Code) | | Creates a table viewer on a newly-created table control under the given
parent. The table control is created using the SWT style bits
MULTI, H_SCROLL, V_SCROLL, and BORDER . The
viewer has no input, no content provider, a default label provider, no
sorter, and no filters. The table has no columns.
Parameters: parent - the parent control |
TableViewer | public TableViewer(Composite parent, int style)(Code) | | Creates a table viewer on a newly-created table control under the given
parent. The table control is created using the given style bits. The
viewer has no input, no content provider, a default label provider, no
sorter, and no filters. The table has no columns.
Parameters: parent - the parent control Parameters: style - SWT style bits |
TableViewer | public TableViewer(Table table)(Code) | | Creates a table viewer on the given table control. The viewer has no
input, no content provider, a default label provider, no sorter, and no
filters.
Parameters: table - the table control |
doClear | protected void doClear(int index)(Code) | | |
doClearAll | protected void doClearAll()(Code) | | |
doDeselectAll | protected void doDeselectAll()(Code) | | |
doGetColumn | protected Widget doGetColumn(int index)(Code) | | |
doGetColumnCount | protected int doGetColumnCount()(Code) | | |
doGetItem | protected Item doGetItem(int index)(Code) | | |
doGetItemCount | protected int doGetItemCount()(Code) | | |
doGetItems | protected Item[] doGetItems()(Code) | | |
doGetSelection | protected Item[] doGetSelection()(Code) | | |
doGetSelectionIndices | protected int[] doGetSelectionIndices()(Code) | | |
doIndexOf | protected int doIndexOf(Item item)(Code) | | |
doRemove | protected void doRemove(int start, int end)(Code) | | |
doRemove | protected void doRemove(int[] indices)(Code) | | |
doRemoveAll | protected void doRemoveAll()(Code) | | |
doResetItem | protected void doResetItem(Item item)(Code) | | |
doSelect | protected void doSelect(int[] indices)(Code) | | |
doSetItemCount | protected void doSetItemCount(int count)(Code) | | |
doSetSelection | protected void doSetSelection(Item[] items)(Code) | | |
doSetSelection | protected void doSetSelection(int[] indices)(Code) | | |
doShowItem | protected void doShowItem(Item item)(Code) | | |
doShowSelection | protected void doShowSelection()(Code) | | |
getControl | public Control getControl()(Code) | | |
getItemAt | protected Item getItemAt(Point p)(Code) | | |
getTable | public Table getTable()(Code) | | Returns this table viewer's table control.
the table control |
getViewerRowFromItem | protected ViewerRow getViewerRowFromItem(Widget item)(Code) | | |
internalCreateNewRowPart | protected ViewerRow internalCreateNewRowPart(int style, int rowIndex)(Code) | | Create a new row with style at index
Parameters: style - Parameters: rowIndex - ViewerRow since: 3.3 |
refresh | public void refresh(Object element, boolean updateLabels, boolean reveal)(Code) | | Refreshes this viewer starting with the given element. Labels are updated
as described in refresh(boolean updateLabels) . The
methods attempts to preserve the selection.
Unlike the update methods, this handles structural changes
to the given element (e.g. addition or removal of children). If only the
given element needs updating, it is more efficient to use the
update methods.
Subclasses who can provide this feature can open this method for the
public
Parameters: element - the element Parameters: updateLabels - true to update labels for existing elements,false to only update labels as needed, assumingthat labels for existing elements are unchanged. Parameters: reveal - true to make the preserved selection visibleafterwards since: 3.3 |
refresh | public void refresh(boolean updateLabels, boolean reveal)(Code) | | Refreshes this viewer with information freshly obtained from this
viewer's model. If updateLabels is true
then labels for otherwise unaffected elements are updated as well.
Otherwise, it assumes labels for existing elements are unchanged, and
labels are only obtained as needed (for example, for new elements).
Calling refresh(true) has the same effect as
refresh() .
Note that the implementation may still obtain labels for existing
elements even if updateLabels is false. The intent is
simply to allow optimization where possible.
Parameters: updateLabels - true to update labels for existing elements,false to only update labels as needed, assumingthat labels for existing elements are unchanged. Parameters: reveal - true to make the preserved selection visibleafterwards since: 3.3 |
setSelection | public void setSelection(ISelection selection, boolean reveal)(Code) | |
Sets a new selection for this viewer and optionally makes it visible. The
TableViewer implementation of this method is inefficient for the
ILazyContentProvider as lookup is done by indices rather than elements
and may require population of the entire table in worse case.
Use Table#setSelection(int[] indices) and Table#showSelection() if you
wish to set selection more efficiently when using a ILazyContentProvider.
Parameters: selection - the new selection Parameters: reveal - true if the selection is to be made visible,and false otherwise See Also: Table.setSelection(int[]) See Also: Table.showSelection |
Methods inherited from org.eclipse.jface.viewers.StructuredViewer | public void addDoubleClickListener(IDoubleClickListener listener)(Code)(Java Doc) public void addDragSupport(int operations, Transfer[] transferTypes, DragSourceListener listener)(Code)(Java Doc) public void addDropSupport(int operations, Transfer[] transferTypes, DropTargetListener listener)(Code)(Java Doc) public void addFilter(ViewerFilter filter)(Code)(Java Doc) public void addOpenListener(IOpenListener listener)(Code)(Java Doc) public void addPostSelectionChangedListener(ISelectionChangedListener listener)(Code)(Java Doc) protected void assertContentProviderType(IContentProvider provider)(Code)(Java Doc) protected void assertElementsNotNull(Object[] elements)(Code)(Java Doc) protected void associate(Object element, Item item)(Code)(Java Doc) protected void buildLabel(ViewerLabel updateLabel, Object element)(Code)(Java Doc) void buildLabel(ViewerLabel updateLabel, Object element, IViewerLabelProvider labelProvider)(Code)(Java Doc) void buildLabel(ViewerLabel updateLabel, TreePath elementPath, ITreePathLabelProvider labelProvider)(Code)(Java Doc) void buildLabel(ViewerLabel updateLabel, Object element, ILabelProvider labelProvider)(Code)(Java Doc) protected void disassociate(Item item)(Code)(Java Doc) abstract protected Widget doFindInputItem(Object element)(Code)(Java Doc) abstract protected Widget doFindItem(Object element)(Code)(Java Doc) abstract protected void doUpdateItem(Widget item, Object element, boolean fullMap)(Code)(Java Doc) protected boolean equals(Object elementA, Object elementB)(Code)(Java Doc) protected Object[] filter(Object[] elements)(Code)(Java Doc) final protected Widget findItem(Object element)(Code)(Java Doc) final protected Widget[] findItems(Object element)(Code)(Java Doc) protected void fireDoubleClick(DoubleClickEvent event)(Code)(Java Doc) protected void fireOpen(OpenEvent event)(Code)(Java Doc) protected void firePostSelectionChanged(SelectionChangedEvent event)(Code)(Java Doc) protected ColorAndFontCollector getColorAndFontCollector()(Code)(Java Doc) public ViewerComparator getComparator()(Code)(Java Doc) public IElementComparer getComparer()(Code)(Java Doc) protected Object[] getFilteredChildren(Object parent)(Code)(Java Doc) public ViewerFilter[] getFilters()(Code)(Java Doc) protected Item getItem(int x, int y)(Code)(Java Doc) protected Object[] getRawChildren(Object parent)(Code)(Java Doc) protected Object getRoot()(Code)(Java Doc) public ISelection getSelection()(Code)(Java Doc) abstract protected List getSelectionFromWidget()(Code)(Java Doc) protected Object[] getSortedChildren(Object parent)(Code)(Java Doc) public ViewerSorter getSorter()(Code)(Java Doc) protected void handleDispose(DisposeEvent event)(Code)(Java Doc) protected void handleDoubleSelect(SelectionEvent event)(Code)(Java Doc) protected void handleInvalidSelection(ISelection invalidSelection, ISelection newSelection)(Code)(Java Doc) protected void handleLabelProviderChanged(LabelProviderChangedEvent event)(Code)(Java Doc) protected void handleOpen(SelectionEvent event)(Code)(Java Doc) protected void handlePostSelect(SelectionEvent e)(Code)(Java Doc) protected void handleSelect(SelectionEvent event)(Code)(Java Doc) protected boolean hasFilters()(Code)(Java Doc) protected void hookControl(Control control)(Code)(Java Doc) abstract protected void internalRefresh(Object element)(Code)(Java Doc) protected void internalRefresh(Object element, boolean updateLabels)(Code)(Java Doc) protected void internalUpdate(Widget widget, Object element, String[] properties)(Code)(Java Doc) protected void mapElement(Object element, Widget item)(Code)(Java Doc) protected boolean needsRefilter(Object element, String property)(Code)(Java Doc) CustomHashtable newHashtable(int capacity)(Code)(Java Doc) protected void preservingSelection(Runnable updateCode)(Code)(Java Doc) void preservingSelection(Runnable updateCode, boolean reveal)(Code)(Java Doc) public void refresh()(Code)(Java Doc) public void refresh(boolean updateLabels)(Code)(Java Doc) public void refresh(Object element)(Code)(Java Doc) public void refresh(Object element, boolean updateLabels)(Code)(Java Doc) final protected void refreshItem(Widget widget, Object element)(Code)(Java Doc) public void removeDoubleClickListener(IDoubleClickListener listener)(Code)(Java Doc) public void removeFilter(ViewerFilter filter)(Code)(Java Doc) public void removeOpenListener(IOpenListener listener)(Code)(Java Doc) public void removePostSelectionChangedListener(ISelectionChangedListener listener)(Code)(Java Doc) public void resetFilters()(Code)(Java Doc) abstract public void reveal(Object element)(Code)(Java Doc) public void setComparator(ViewerComparator comparator)(Code)(Java Doc) public void setComparer(IElementComparer comparer)(Code)(Java Doc) public void setContentProvider(IContentProvider provider)(Code)(Java Doc) public void setFilters(ViewerFilter[] filters)(Code)(Java Doc) final public void setInput(Object input)(Code)(Java Doc) public void setLabelProvider(IBaseLabelProvider labelProvider)(Code)(Java Doc) public void setSelection(ISelection selection, boolean reveal)(Code)(Java Doc) abstract protected void setSelectionToWidget(List l, boolean reveal)(Code)(Java Doc) protected void setSelectionToWidget(ISelection selection, boolean reveal)(Code)(Java Doc) public void setSorter(ViewerSorter sorter)(Code)(Java Doc) public void setUseHashlookup(boolean enable)(Code)(Java Doc) public Widget testFindItem(Object element)(Code)(Java Doc) public Widget[] testFindItems(Object element)(Code)(Java Doc) protected void unmapAllElements()(Code)(Java Doc) protected void unmapElement(Object element)(Code)(Java Doc) protected void unmapElement(Object element, Widget item)(Code)(Java Doc) public void update(Object[] elements, String[] properties)(Code)(Java Doc) public void update(Object element, String[] properties)(Code)(Java Doc) final protected void updateItem(Widget widget, Object element)(Code)(Java Doc) protected void updateSelection(ISelection selection)(Code)(Java Doc) protected boolean usingElementMap()(Code)(Java Doc)
|
Fields inherited from org.eclipse.jface.viewers.Viewer | final protected static String WIDGET_DATA_KEY(Code)(Java Doc)
|
|
|