|
Eclipse Platform Release 3.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.jface.viewers.Viewer org.eclipse.jface.viewers.ContentViewer org.eclipse.jface.viewers.StructuredViewer org.eclipse.jface.viewers.TableViewer
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).
Field Summary |
Fields inherited from class org.eclipse.jface.viewers.Viewer |
WIDGET_DATA_KEY |
Constructor Summary | |
TableViewer(Composite parent)
Creates a table viewer on a newly-created table control under the given parent. | |
TableViewer(Composite parent,
int style)
Creates a table viewer on a newly-created table control under the given parent. | |
TableViewer(Table table)
Creates a table viewer on the given table control. |
Method Summary | |
void | add(Object element)
Adds the given element to this table viewer. |
void | add(Object[] elements)
Adds the given elements to this table viewer. |
void | cancelEditing()
Cancels a currently active cell editor. |
protected Widget | doFindInputItem(Object element)
Returns the widget in this viewer's control which represents the given element if it is the viewer's input. |
protected Widget | doFindItem(Object element)
Returns the widget in this viewer's control which represent the given element. |
protected void | doUpdateItem(Widget widget,
Object element,
boolean fullMap)
Copies the attributes of the given element into the given SWT item. |
void | editElement(Object element,
int column)
Starts editing the given element. |
CellEditor[] | getCellEditors()
Returns the cell editors of this table viewer. |
ICellModifier | getCellModifier()
Returns the cell modifier of this table viewer. |
Object[] | getColumnProperties()
Returns the column properties of this table viewer. |
Control | getControl()
Returns the primary control associated with this viewer. |
Object | getElementAt(int index)
Returns the element with the given index from this table viewer. |
IBaseLabelProvider | getLabelProvider()
The table viewer implementation of this Viewer framework method returns the label provider, which in the case of table viewers will be an instance of either ITableLabelProvider or ILabelProvider. |
protected List | getSelectionFromWidget()
Retrieves the selection, as a List, from the underlying widget. |
Table | getTable()
Returns this table viewer's table control. |
protected void | hookControl(Control control)
Adds event listener hooks to the given control. |
protected int | indexForElement(Object element)
|
protected void | inputChanged(Object input,
Object oldInput)
Internal hook method called when the input to this viewer is initially set or subsequently changed. |
void | insert(Object element,
int position)
Inserts the given element into this table viewer at the given position. |
protected void | internalRefresh(Object element)
Refreshes this viewer starting at the given element. |
protected void | internalRefresh(Object element,
boolean updateLabels)
Refreshes this viewer starting at the given element. |
boolean | isCellEditorActive()
Returns whether there is an active cell editor. |
void | remove(Object element)
Removes the given element from this table viewer. |
void | remove(Object[] elements)
Removes the given elements from this table viewer. |
void | reveal(Object element)
Ensures that the given element is visible, scrolling the viewer if necessary. |
void | setCellEditors(CellEditor[] editors)
Sets the cell editors of this table viewer. |
void | setCellModifier(ICellModifier modifier)
Sets the cell modifier of this table viewer. |
void | setColumnProperties(String[] columnProperties)
Sets the column properties of this table viewer. |
void | setLabelProvider(IBaseLabelProvider labelProvider)
The table viewer implementation of this Viewer framework method ensures that the given label provider is an instance of either ITableLabelProvider or ILabelProvider. |
protected void | setSelectionToWidget(List list,
boolean reveal)
Parlays the given list of selected elements into selections on this viewer's control. |
Methods inherited from class org.eclipse.jface.viewers.ContentViewer |
getContentProvider, getInput, handleDispose, labelProviderChanged |
Methods inherited from class org.eclipse.jface.viewers.Viewer |
addHelpListener, addSelectionChangedListener, fireHelpRequested, fireSelectionChanged, getData, handleHelpRequest, removeHelpListener, removeSelectionChangedListener, scrollDown, scrollUp, setData, setSelection |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.jface.viewers.ISelectionProvider |
addSelectionChangedListener, removeSelectionChangedListener, setSelection |
Constructor Detail |
public TableViewer(Composite parent)
public TableViewer(Composite parent, int style)
public TableViewer(Table table)
Method Detail |
public void add(Object[] elements)
This method should be called (by the content provider) when elements have been added to the model, in order to cause the viewer to accurately reflect the model. This method only affects the viewer, not the model.
public void add(Object element)
This method should be called (by the content provider) when a single element has been added to the model, in order to cause the viewer to accurately reflect the model. This method only affects the viewer, not the model. Note that there is another method for efficiently processing the simultaneous addition of multiple elements.
public void cancelEditing()
protected Widget doFindInputItem(Object element)
This method is internal to the framework; subclassers should not call this method.
protected Widget doFindItem(Object element)
This method is internal to the framework; subclassers should not call this method.
protected void doUpdateItem(Widget widget, Object element, boolean fullMap)
This method is internal to the framework; subclassers should not call this method.
public void editElement(Object element, int column)
public CellEditor[] getCellEditors()
public ICellModifier getCellModifier()
public Object[] getColumnProperties()
public Control getControl()
public Object getElementAt(int index)
This method is internal to the framework.
public IBaseLabelProvider getLabelProvider()
protected List getSelectionFromWidget()
public Table getTable()
protected void hookControl(Control control)
All subclasses must call this method when their control is first established.
The ContentViewer implementation of this method hooks dispose events for the given control. Subclasses may override if they need to add other control hooks; however, super.hookControl must be invoked.
protected int indexForElement(Object element)
protected void inputChanged(Object input, Object oldInput)
The default implementation does nothing. Subclassers may override this method to do something when a viewer's input is set. A typical use is populate the viewer.
public void insert(Object element, int position)
This method should be called (by the content provider) when elements have been added to the model, in order to cause the viewer to accurately reflect the model. This method only affects the viewer, not the model.
protected void internalRefresh(Object element)
protected void internalRefresh(Object element, boolean updateLabels)
The default implementation simply calls internalRefresh(element), ignoring updateLabels.
If this method is overridden to do the actual refresh, then internalRefresh(Object element) should simply call internalRefresh(element, true).
public boolean isCellEditorActive()
public void remove(Object[] elements)
This method should be called (by the content provider) when elements have been removed from the model, in order to cause the viewer to accurately reflect the model. This method only affects the viewer, not the model.
public void remove(Object element)
This method should be called (by the content provider) when a single element has been removed from the model, in order to cause the viewer to accurately reflect the model. This method only affects the viewer, not the model. Note that there is another method for efficiently processing the simultaneous removal of multiple elements.
public void reveal(Object element)
public void setCellEditors(CellEditor[] editors)
public void setCellModifier(ICellModifier modifier)
public void setColumnProperties(String[] columnProperties)
public void setLabelProvider(IBaseLabelProvider labelProvider)
protected void setSelectionToWidget(List list, boolean reveal)
Subclasses should override to set their selection based on the given list of elements.
|
Eclipse Platform Release 3.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.