Class HTMLTableColumn<T>
java.lang.Object
com.amalgamasimulation.desktop.html.tables.HTMLTableColumn<T>
- Type Parameters:
T- the type of data in the table
The HTMLTableColumn class represents a column in an HTML table. It provides
methods for extracting cell values and applying styles dynamically.
- Author:
- Alexey Glazyrin
-
Constructor Summary
ConstructorsConstructorDescriptionHTMLTableColumn(Function<T, String> extractor, String title) Constructs a new HTMLTableColumn instance with the specified value extractor and title. -
Method Summary
Modifier and TypeMethodDescriptionbackgroundColor(Function<T, Color> colorExtractor) fontItalic(Function<T, Boolean> valueExtractor) fontSizeInPt(Function<T, Integer> sizeInPointsExtractor) fontSizeInPx(Function<T, Integer> sizeInPixelsExtractor) header()voidsetCellStyleExtractor(Function<T, String> cellStyleExtractor) Sets the function to extract the CSS style for a cell based on the data.Generates the HTML tag for a cell in the column based on the provided data.
-
Constructor Details
-
HTMLTableColumn
Constructs a new HTMLTableColumn instance with the specified value extractor and title.- Parameters:
extractor- a function to extract the cell value from the datatitle- the title of the column
-
-
Method Details
-
setCellStyleExtractor
Sets the function to extract the CSS style for a cell based on the data.- Parameters:
cellStyleExtractor- the function to extract the CSS style
-
toDataTag
Generates the HTML tag for a cell in the column based on the provided data.- Parameters:
dataItem- the data for the cell- Returns:
- the HTML tag representing the cell
-
header
-
backgroundColor
-
fontColor
-
fontBold
-
fontItalic
-
fontSizeInPx
-
fontSizeInPt
-