public class TableComponentCellContentProvider extends java.lang.Object implements IVizCellContentProvider
TableComponent
.
This class is designed so that a single backing content provider can be
re-used for each column in a table, as all elements in a
TableComponent
are the same data structure (see Entry
).
The element object passed to instances of this content provider is expected
to be a List
of Entry
s.
Constructor and Description |
---|
TableComponentCellContentProvider(IVizCellContentProvider contentProvider,
int index)
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
org.eclipse.swt.graphics.Image |
getImage(java.lang.Object element)
Gets an
Image representing the specified element. |
java.lang.String |
getText(java.lang.Object element)
Gets the string to display for the specified element's cell.
|
java.lang.String |
getToolTipText(java.lang.Object element)
Gets the string to display for the specified element's cell tool tip.
|
java.lang.Object |
getValue(java.lang.Object element)
Gets the current value associated with the specified element.
|
boolean |
isEnabled(java.lang.Object element)
Gets whether or not the specified element's cell should be enabled.
|
boolean |
isValid(java.lang.Object element)
Gets whether or not the specified element is a valid
Object
to be put in a cell. |
boolean |
setValue(java.lang.Object element,
java.lang.Object value)
Sets a new value for the specified element.
|
public TableComponentCellContentProvider(IVizCellContentProvider contentProvider, int index)
contentProvider
- The underlying content provider used for each cell in the
JFace viewer.index
- The column index for this provider. This provider expects a
row (which should be a List
) as input, and this index
specifies which column in that row provides the real content
for the cell.public org.eclipse.swt.graphics.Image getImage(java.lang.Object element)
IVizCellContentProvider
Image
representing the specified element. This will
be placed in its cell.getImage
in interface IVizCellContentProvider
element
- The element that needs a cell Image
.Image
for the cell, or null if Image
s are not supported.public java.lang.String getText(java.lang.Object element)
IVizCellContentProvider
getText
in interface IVizCellContentProvider
element
- The element that needs a string.null
.public java.lang.String getToolTipText(java.lang.Object element)
IVizCellContentProvider
getToolTipText
in interface IVizCellContentProvider
element
- The element that needs a tool tip.null
.public java.lang.Object getValue(java.lang.Object element)
IVizCellContentProvider
getValue
in interface IVizCellContentProvider
element
- The element whose value is requested.public boolean isEnabled(java.lang.Object element)
IVizCellContentProvider
isEnabled
in interface IVizCellContentProvider
element
- The element to test.public boolean isValid(java.lang.Object element)
IVizCellContentProvider
Object
to be put in a cell.isValid
in interface IVizCellContentProvider
element
- The element to test.public boolean setValue(java.lang.Object element, java.lang.Object value)
IVizCellContentProvider
setValue
in interface IVizCellContentProvider
element
- The element whose value is being set.value
- The value that should be set for the element. This is expected
to match the underlying element's value type.