Class EasyColumn<T,V>
java.lang.Object
com.flowingcode.vaadin.addons.easygrid.EasyColumn<T,V>
- Type Parameters:
T- the grid bean typeV- the column value type
- All Implemented Interfaces:
IEasyGridColumn<T,,V> Serializable
Wraps a
Grid.Column and provides type-specific formatting for an EasyGridAddon-managed
column.- See Also:
-
Method Summary
Modifier and TypeMethodDescription<S> EasyColumn<T,S> Returns this column cast to value typeS, analogously toClass.asSubclass(java.lang.Class<U>).EasyColumn<T,V> setFormatter(SerializableFunction<V, String> formatter) Sets a custom formatter that converts the column value to a display string.EasyColumn<T,V> setNullRepresentation(String nullRepresentation) Sets the string to display when the column value isnull.EasyColumn<T,V> setRendererFactory(RendererFactory<T, V> rendererFactory) Sets a custom renderer factory for this column.EasyColumn<T,V> setTextAlign(ColumnTextAlign textAlign) Sets the text alignment for this column's cells.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.flowingcode.vaadin.addons.easygrid.IEasyGridColumn
getColumn, setAutoWidth, setComparator, setComparator, setEditorComponent, setEditorComponent, setFlexGrow, setFooter, setFooter, setFooterPartName, setFrozen, setFrozenToEnd, setHeader, setHeader, setHeaderPartName, setKey, setPartNameGenerator, setResizable, setRowHeader, setSortable, setSortOrderProvider, setSortProperty, setTooltipGenerator, setVisible, setWidth
-
Method Details
-
as
Returns this column cast to value typeS, analogously toClass.asSubclass(java.lang.Class<U>). Succeeds when the column's actual value type is a subtype ofS; throws otherwise.- Type Parameters:
S- the target value type- Parameters:
type- the target value type class- Returns:
- this column cast to
EasyColumn<T, S> - Throws:
ClassCastException- if the column's actual value type is not a subtype oftype
-
setNullRepresentation
Sets the string to display when the column value isnull. Overrides any null representation inherited from the type or global configuration. Updates the underlying configuration and re-applies the renderer.- Parameters:
nullRepresentation- the string to show fornullvalues- Returns:
- this column, for fluent chaining
-
setFormatter
Sets a custom formatter that converts the column value to a display string. Overrides any type-specific or formatter-based renderer inherited from the configuration chain.- Parameters:
formatter- a function mapping a column value to its display string- Returns:
- this column, for fluent chaining
-
setRendererFactory
Sets a custom renderer factory for this column. Overrides any type-specific or formatter-based renderer inherited from the configuration chain.- Parameters:
rendererFactory- a factory that creates a renderer from a value provider- Returns:
- this column, for fluent chaining
-
setTextAlign
Sets the text alignment for this column's cells. Updates both the underlyingGrid.Columnand theColumnConfiguration.- Specified by:
setTextAlignin interfaceIEasyGridColumn<T,V> - Parameters:
textAlign- the text alignment to apply- Returns:
- this column, for fluent chaining
-