Package swingtree
Class CellDelegate<C extends JComponent,V>
java.lang.Object
swingtree.CellDelegate<C,V>
- Type Parameters:
V
- The value type of the entry of thisCellDelegate
.
This class models the state of an individual table/list/drop down cell alongside
various properties that a cell should have, like for example
the value of the cell, its position within the table
as well as a renderer in the form of a AWT
When configuring your cell, you may use methods like
Component
which may or not be replaced or modified.
When configuring your cell, you may use methods like
withRenderer(Component)
or withRenderer(Consumer)
to define how the cell should be rendered.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
int
getRow()
boolean
hasFocus()
boolean
The presentation value is the first choice of the cell renderer to be used for rendering and presentation to the user.renderer()
value()
withPresentationValue
(@Nullable Object toBeShown) Represents the value how it should be displayed to the user by the cell renderer.withRenderer
(Component component) withRenderer
(Consumer<Graphics2D> painter) withToolTip
(String toolTip)
-
Constructor Details
-
CellDelegate
-
-
Method Details
-
getComponent
-
value
-
valueAsString
-
isSelected
public boolean isSelected() -
hasFocus
public boolean hasFocus() -
getRow
public int getRow() -
getColumn
public int getColumn() -
renderer
-
withRenderer
-
withRenderer
-
withToolTip
-
presentationValue
The presentation value is the first choice of the cell renderer to be used for rendering and presentation to the user. If it does not exist then the regular cell value is used for rendering.- Returns:
- An optional of the presentation value. It may be an empty optional if no presentation value was specified.
-
withPresentationValue
Represents the value how it should be displayed to the user by the cell renderer. By default, this value is null, in which case the regular cell value is presented to the user.- Parameters:
toBeShown
- The object which should be used by the renderer to present to the user, typically a String.- Returns:
- An updated cell delegate object with the new presentation value.
-
withDefaultRenderer
-