Closed leewyatt closed 1 month ago
The two properties "show month dropdown" and "enable month selection view" are not redundant as the first one shows or hides the dropdown arrow while the second one enables the month selection view in general. If NO dropdown is shown the user can still click on the month to bring up the month selection view.
The properties "year spinner" vs. "year dropdown" could be replaced with an enum:
Similar for the month:
Redundant listeners for mouse clicks can be removed.
This proposal addresses several issue in the CalendarView component. Our aim is to streamline the component and enhance clarity for developers.
Redundant Property Usage:
The disableMonthDropdownButtonProperty and disableYearDropdownButtonProperty are redundant as their functionality is effectively managed by other properties like monthSelectionViewEnabledProperty.
Unnecessary Binding Dependencies:
The binding of yearSpinnerBox.visibleProperty() to showYearDropdownProperty is unnecessary because dropdown visibility is controllable through view.setShowMonthDropdown(false), and customization options allow the monthDropdownArrowButton to diverge from being a typical arrow button. This dependency could be removed to simplify component behavior.
Redundant Mouse Click Event Handlers:
The button used as the graphic in dateLabel has its own setOnMouseClick event handler, which is redundant because dateLabel already handles mouse clicks with similar logic. This redundancy can be removed to streamline interactions and reduce code complexity.