H
- the Cell
typepublic abstract class Header<H>
extends java.lang.Object
Constructor and Description |
---|
Header(Cell<H> cell)
Construct a Header with a given
Cell . |
Modifier and Type | Method and Description |
---|---|
Cell<H> |
getCell()
Return the
Cell responsible for rendering items in the header. |
java.lang.String |
getHeaderStyleNames()
Get extra style names that should be applied to a cell in this header.
|
java.lang.Object |
getKey()
Get the key for the header value.
|
abstract H |
getValue()
Return the header value.
|
void |
onBrowserEvent(Cell.Context context,
Element elem,
NativeEvent event)
Handle a browser event that took place within the header.
|
boolean |
onPreviewColumnSortEvent(Cell.Context context,
Element elem,
NativeEvent event)
Preview a browser event that may trigger a column sort event.
|
void |
render(Cell.Context context,
SafeHtmlBuilder sb)
Render the header.
|
void |
setHeaderStyleNames(java.lang.String styleNames)
Set extra style names that should be applied to every cell in this header.
|
void |
setUpdater(ValueUpdater<H> updater)
Set the
ValueUpdater . |
public Cell<H> getCell()
Cell
responsible for rendering items in the header.public java.lang.String getHeaderStyleNames()
getValue()
.null
if there are no extra styles for the cells in this
headerpublic java.lang.Object getKey()
public abstract H getValue()
public void onBrowserEvent(Cell.Context context, Element elem, NativeEvent event)
context
- the context of the headerelem
- the parent Elementevent
- the native browser eventpublic boolean onPreviewColumnSortEvent(Cell.Context context, Element elem, NativeEvent event)
CellTable
should proceed with sorting the column. Subclasses can override this method
to disable column sort for some click events, or particular header/footer sections.
This method will be invoked even if the header's cell does not consume a click event.
context
- the context of the headerelem
- the parent Elementevent
- the native browser eventCellTable
should continue respond to the event (i.e., if this is
a click event on a sortable column's header, fire ColumnSortEvent
). False if
the CellTable
should stop respond to the event.public void render(Cell.Context context, SafeHtmlBuilder sb)
context
- the context of the headersb
- a SafeHtmlBuilder
to render intopublic void setHeaderStyleNames(java.lang.String styleNames)
If you want to apply style names based on the header value, override
#getHeaderStyleNames(Object)
directly.
styleNames
- the extra style names to apply in a space-separated list,
or null
if there are no extra styles for this cellpublic void setUpdater(ValueUpdater<H> updater)
ValueUpdater
.updater
- the value updater to use