T - denotes the calendar system to be used@FunctionalInterface public interface CellCustomizer<T extends CalendarDate>
Enables customizations of date cells in the month view.
Example for disabling and painting (localized) weekend columns in another color:
CalendarPicker<PlainDate> picker = CalendarPicker.gregorianWithSystemDefaults();
picker.cellCustomizerProperty().set(
(cell, column, row, model, date) -> {
if (CellCustomizer.isWeekend(column, model)) {
cell.setStyle("-fx-background-color: #FFE0E0;");
cell.setDisable(true);
}
}
);
| Modifier and Type | Method and Description |
|---|---|
void |
customize(javafx.scene.Node cell,
int column,
int row,
Weekmodel model,
Optional<T> date)
Performs any user-defined customization of given date cell.
|
static Weekday |
getDayOfWeek(int column,
Weekmodel model)
Convenient method to determine the day-of-week in given column of calendar.
|
static boolean |
isWeekend(int column,
Weekmodel model)
Convenient method to determine the localized weekend.
|
void customize(javafx.scene.Node cell,
int column,
int row,
Weekmodel model,
Optional<T> date)
Performs any user-defined customization of given date cell.
cell - the cell which contains a calendar datecolumn - zero-based column indexrow - zero-based row indexmodel - localized week modeldate - associated calendar date (not present if out of min-max-range)static boolean isWeekend(int column,
Weekmodel model)
Convenient method to determine the localized weekend.
Note that the weekend does not always match Saturday and Sunday dependent on current locale and calendar system.
column - zero-based column indexmodel - localized week modeltrue if given column matches a weekend else falsestatic Weekday getDayOfWeek(int column, Weekmodel model)
Convenient method to determine the day-of-week in given column of calendar.
Note that the order of weekdays depends on current locale and calendar system. This method works even for empty calendar cells.
column - zero-based column indexmodel - localized week modelCopyright © 2014–2021. All rights reserved.