Top Description Inners Fields Constructors Methods
com.calendarfx.view

public Class YearMonthView

extends MonthViewBase
Class Inheritance
Imports
impl.com.calendarfx.view.YearMonthViewSkin, javafx.beans.property.BooleanProperty, .ObjectProperty, .SimpleBooleanProperty, .SimpleObjectProperty, javafx.beans.value.ObservableValue, javafx.collections.ObservableList, javafx.scene.control.Label, .Skin, javafx.util.Callback, org.controlsfx.control.PropertySheet.Item, java.time.LocalDate, java.util.Optional

Displays a given month of a given year. The view can be configured in many ways: Additionally the application can choose from two different behaviours when the user clicks on a date:
  1. Perform a selection / select the date
  2. Show details of the date (by default shows a popover with all entries on that date)
The image below shows the visual apperance of this control: Date Picker

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
YearMonthView.ClickBehaviour

An enumerator to control the behaviour of the control when the user clicks on a date.

public static class
YearMonthView.DateCell

The base date cell implementation for month views.

Field Summary

Modifier and TypeField and Description
private final ObjectProperty<Callback<YearMonthView, YearMonthView.DateCell>>
private final ObjectProperty<YearMonthView.ClickBehaviour>
private static final String
private final BooleanProperty
private final BooleanProperty
private final BooleanProperty
private final BooleanProperty
private final BooleanProperty
private final BooleanProperty

Constructor Summary

AccessConstructor and Description
public
YearMonthView()

Constructs a new view.

Method Summary

Modifier and TypeMethod and Description
public final ObjectProperty<Callback<YearMonthView, YearMonthView.DateCell>>

Returns:

the cell factory
cellFactoryProperty
()

A factory for creating alternative content for the month view.

public final ObjectProperty<YearMonthView.ClickBehaviour>

Returns:

the click behaviour
clickBehaviourProperty
()

The behaviour used when the user clicks on a date.

protected Skin<?>
createDefaultSkin()

Overrides javafx.scene.control.Control.createDefaultSkin.

Create a new instance of the default skin for this control.

public final Callback<YearMonthView, YearMonthView.DateCell>

Returns:

the cell factory
getCellFactory
()

Returns the value of cellFactoryProperty().

public final YearMonthView.ClickBehaviour

Returns:

the click behaviour
getClickBehaviour
()

Returns the value of clickBehaviourProperty().

public ObservableList<PropertySheet.Item>
getPropertySheetItems()

Overrides com.calendarfx.view.MonthViewBase.getPropertySheetItems.

Returns a list of property items that can be shown by the PropertySheet of ControlsFX.

public final boolean

Returns:

true if the month name will be shown
isShowMonth
()

Returns the value of showMonthProperty().

public final boolean

Returns:

true if the arrows will be shown
isShowMonthArrows
()

Returns the value of the showMonthArrowsProperty().

public final boolean

Returns:

true if the button is shown
isShowTodayButton
()

Returns the value of the showTodayButtonProperty().

public final boolean

Returns:

true if the colors will be shown
isShowUsageColors
()

Returns the value of the showUsageColorsProperty().

public final boolean

Returns:

true if the year will be shown
isShowYear
()

Returns the value of showYearProperty().

public final boolean

Returns:

true if the arrows will be shown
isShowYearArrows
()

Returns the value of the showYearArrowsProperty().

public final void
public final void
setClickBehaviour(YearMonthView.ClickBehaviour
the click behaviour
behaviour
)

Sets the value of clickBehaviourProperty().

public final void
setShowMonth(boolean
if true the month will be shown
show
)

Sets the value of showMonthProperty().

public final void
setShowMonthArrows(boolean
if true will show the arrows
show
)

Sets the value of the showMonthArrowsProperty().

public final void
setShowTodayButton(boolean
if true will show the button
show
)

Sets the value of the showTodayButtonProperty().

public final void
setShowUsageColors(boolean
if true will show the colors
show
)

Sets the value of showUsageColorsProperty().

public final void
setShowYear(boolean
if true the year will be shown
show
)

Sets the value of showYearProperty().

public final void
setShowYearArrows(boolean
if true will show the arrows
show
)

Sets the value of the showYearArrowsProperty().

public final BooleanProperty

Returns:

true if the arrows will be shown
showMonthArrowsProperty
()

Shows or hides the arrows to change the month.

public final BooleanProperty

Returns:

true if the month name will be shown
showMonthProperty
()

Show or hide the name of the month.

public final BooleanProperty

Returns:

true if the button will be shown
showTodayButtonProperty
()

Show or hide a button to quickly go to today's date.

public final BooleanProperty

Returns:

true if the usage colors will be shown
showUsageColorsProperty
()

Show or hide usage colors that are based on the number of entries on a given date.

public final BooleanProperty

Returns:

true if the arrows will be shown
showYearArrowsProperty
()

Shows or hides the arrows to change the year.

public final BooleanProperty

Returns:

true if the year will be shown
showYearProperty
()

Show or hide the year.

Inherited from com.calendarfx.view.MonthViewBase:
getSelectedDatesgetYearMonthisShowWeekNumberssetShowWeekNumbersshowWeekNumbersPropertyyearMonthProperty

Field Detail

cellFactoryback to summary
private final ObjectProperty<Callback<YearMonthView, YearMonthView.DateCell>> cellFactory
clickBehaviourback to summary
private final ObjectProperty<YearMonthView.ClickBehaviour> clickBehaviour
MONTH_VIEW_CATEGORYback to summary
private static final String MONTH_VIEW_CATEGORY

Hides com.calendarfx.view.MonthViewBase.MONTH_VIEW_CATEGORY.

showMonthback to summary
private final BooleanProperty showMonth
showMonthArrowsback to summary
private final BooleanProperty showMonthArrows
showTodayButtonback to summary
private final BooleanProperty showTodayButton
showUsageColorsback to summary
private final BooleanProperty showUsageColors
showYearback to summary
private final BooleanProperty showYear
showYearArrowsback to summary
private final BooleanProperty showYearArrows

Constructor Detail

YearMonthViewback to summary
public YearMonthView()

Constructs a new view.

Method Detail

cellFactoryPropertyback to summary
public final ObjectProperty<Callback<YearMonthView, YearMonthView.DateCell>> cellFactoryProperty()

A factory for creating alternative content for the month view. The image below shows the YearMonthView once with the default factory and once with an alternative factory that creates checkboxes. Month Cell Factory

Returns:ObjectProperty<Callback<YearMonthView, YearMonthView.DateCell>>

the cell factory

clickBehaviourPropertyback to summary
public final ObjectProperty<YearMonthView.ClickBehaviour> clickBehaviourProperty()

The behaviour used when the user clicks on a date.

Returns:ObjectProperty<YearMonthView.ClickBehaviour>

the click behaviour

createDefaultSkinback to summary
protected Skin<?> createDefaultSkin()

Overrides javafx.scene.control.Control.createDefaultSkin.

Doc from javafx.scene.control.Control.createDefaultSkin.

Create a new instance of the default skin for this control. This is called to create a skin for the control if no skin is provided via CSS -fx-skin or set explicitly in a sub-class with setSkin(...).

Returns:Skin<?>

new instance of default skin for this control. If null then the control will have no skin unless one is provided by css.

Annotations
@Override
getCellFactoryback to summary
public final Callback<YearMonthView, YearMonthView.DateCell> getCellFactory()

Returns the value of cellFactoryProperty().

Returns:Callback<YearMonthView, YearMonthView.DateCell>

the cell factory

getClickBehaviourback to summary
public final YearMonthView.ClickBehaviour getClickBehaviour()

Returns the value of clickBehaviourProperty().

Returns:YearMonthView.ClickBehaviour

the click behaviour

getPropertySheetItemsback to summary
public ObservableList<PropertySheet.Item> getPropertySheetItems()

Overrides com.calendarfx.view.MonthViewBase.getPropertySheetItems.

Doc from com.calendarfx.view.CalendarFXControl.getPropertySheetItems.

Returns a list of property items that can be shown by the PropertySheet of ControlsFX.

Returns:ObservableList<PropertySheet.Item>

the property sheet items

Annotations
@Override
isShowMonthback to summary
public final boolean isShowMonth()

Returns the value of showMonthProperty().

Returns:boolean

true if the month name will be shown

isShowMonthArrowsback to summary
public final boolean isShowMonthArrows()

Returns the value of the showMonthArrowsProperty().

Returns:boolean

true if the arrows will be shown

isShowTodayButtonback to summary
public final boolean isShowTodayButton()

Returns the value of the showTodayButtonProperty().

Returns:boolean

true if the button is shown

isShowUsageColorsback to summary
public final boolean isShowUsageColors()

Returns the value of the showUsageColorsProperty().

Returns:boolean

true if the colors will be shown

isShowYearback to summary
public final boolean isShowYear()

Returns the value of showYearProperty().

Returns:boolean

true if the year will be shown

isShowYearArrowsback to summary
public final boolean isShowYearArrows()

Returns the value of the showYearArrowsProperty().

Returns:boolean

true if the arrows will be shown

setCellFactoryback to summary
public final void setCellFactory(Callback<YearMonthView, YearMonthView.DateCell> factory)

Sets the value of cellFactoryProperty().

Parameters
factory:Callback<YearMonthView, YearMonthView.DateCell>

the cell factory

setClickBehaviourback to summary
public final void setClickBehaviour(YearMonthView.ClickBehaviour behaviour)

Sets the value of clickBehaviourProperty().

Parameters
behaviour:YearMonthView.ClickBehaviour

the click behaviour

setShowMonthback to summary
public final void setShowMonth(boolean show)

Sets the value of showMonthProperty().

Parameters
show:boolean

if true the month will be shown

setShowMonthArrowsback to summary
public final void setShowMonthArrows(boolean show)

Sets the value of the showMonthArrowsProperty().

Parameters
show:boolean

if true will show the arrows

setShowTodayButtonback to summary
public final void setShowTodayButton(boolean show)

Sets the value of the showTodayButtonProperty().

Parameters
show:boolean

if true will show the button

setShowUsageColorsback to summary
public final void setShowUsageColors(boolean show)

Sets the value of showUsageColorsProperty().

Parameters
show:boolean

if true will show the colors

setShowYearback to summary
public final void setShowYear(boolean show)

Sets the value of showYearProperty().

Parameters
show:boolean

if true the year will be shown

setShowYearArrowsback to summary
public final void setShowYearArrows(boolean show)

Sets the value of the showYearArrowsProperty().

Parameters
show:boolean

if true will show the arrows

showMonthArrowsPropertyback to summary
public final BooleanProperty showMonthArrowsProperty()

Shows or hides the arrows to change the month.

Returns:BooleanProperty

true if the arrows will be shown

showMonthPropertyback to summary
public final BooleanProperty showMonthProperty()

Show or hide the name of the month.

Returns:BooleanProperty

true if the month name will be shown

showTodayButtonPropertyback to summary
public final BooleanProperty showTodayButtonProperty()

Show or hide a button to quickly go to today's date.

Returns:BooleanProperty

true if the button will be shown

showUsageColorsPropertyback to summary
public final BooleanProperty showUsageColorsProperty()

Show or hide usage colors that are based on the number of entries on a given date. The image below shows those colors in action: Usage Colors

Returns:BooleanProperty

true if the usage colors will be shown

showYearArrowsPropertyback to summary
public final BooleanProperty showYearArrowsProperty()

Shows or hides the arrows to change the year.

Returns:BooleanProperty

true if the arrows will be shown

showYearPropertyback to summary
public final BooleanProperty showYearProperty()

Show or hide the year.

Returns:BooleanProperty

true if the year will be shown

com.calendarfx.view back to summary

public final Enum YearMonthView.ClickBehaviour

extends Enum<YearMonthView.ClickBehaviour>
Class Inheritance

An enumerator to control the behaviour of the control when the user clicks on a date.
See Also
YearMonthView#clickBehaviourProperty()

Field Summary

Modifier and TypeField and Description
public static final YearMonthView.ClickBehaviour
NONE

Do nothing when the user clicks on a date.

public static final YearMonthView.ClickBehaviour
PERFORM_SELECTION

A value used to make the control select the date on which the user clicked.

public static final YearMonthView.ClickBehaviour
SHOW_DETAILS

A value used to make the control show some kind of dialog or popover to show details about the clicked date.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static YearMonthView.ClickBehaviour
public static YearMonthView.ClickBehaviour[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

NONEback to summary
public static final YearMonthView.ClickBehaviour NONE

Do nothing when the user clicks on a date.

PERFORM_SELECTIONback to summary
public static final YearMonthView.ClickBehaviour PERFORM_SELECTION

A value used to make the control select the date on which the user clicked.

SHOW_DETAILSback to summary
public static final YearMonthView.ClickBehaviour SHOW_DETAILS

A value used to make the control show some kind of dialog or popover to show details about the clicked date.

Constructor Detail

ClickBehaviourback to summary
private ClickBehaviour()

Method Detail

valueOfback to summary
public static YearMonthView.ClickBehaviour valueOf(String name)
valuesback to summary
public static YearMonthView.ClickBehaviour[] values()
com.calendarfx.view back to summary

public Class YearMonthView.DateCell

extends Label
Class Inheritance

The base date cell implementation for month views.
See Also
setCellFactory(Callback)

Field Summary

Modifier and TypeField and Description
private LocalDate

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final LocalDate
public final void
protected void
Inherited from javafx.scene.control.Label:
createDefaultSkingetInitialFocusTraversablegetLabelForlabelForPropertysetLabelFor

Field Detail

dateback to summary
private LocalDate date

Constructor Detail

DateCellback to summary
public DateCell()

Method Detail

getDateback to summary
public final LocalDate getDate()
setDateback to summary
public final void setDate(LocalDate date)
updateback to summary
protected void update(LocalDate date)