EN · DE · RU · FR · ES

#2777: ButtonText.java

projectforge-wicket/src/main/java/net/ftlines/wicket/fullcalendar/ButtonText.java Java DTO (FullCalendar Button Labels) · projectforge-wicket/src/main/java/net/ftlines/wicket/fullcalendar/ButtonText.java 115 lines · 61 code · 33 comments · 21 blank
A simple data transfer object modeling the button label configuration for the FullCalendar JavaScript widget. Holds string properties for each calendar navigation button: previous month, next month, previous year, next year, today, month view, week view, and day view. Implements a fluent builder pattern — every setter returns this — allowing calendar configuration to be composed inline. Serialized to JSON by Jackson and embedded in the FullCalendar initialization JavaScript.

Architecture

Design Pattern: Fluent DTO

All setters return ButtonText (not void), enabling chained calls: new ButtonText().setPrev("Zurück").setNext("Vor").setToday("Heute"). This is the standard pattern throughout the FullCalendar model classes (Config, Event, EventSource, Header) — all use fluent setters for concise configuration in Java code.

Serialization

Jackson serializes this object to a JSON object like {"prev":"Prev","next":"Next","prevYear":"Prev Year",...}. Only non-null fields are included (Jackson's default behavior), so if a button text isn't customized, the FullCalendar JavaScript client falls back to its built-in defaults for that button.

Eight Button Positions

The FullCalendar header can display buttons in three sections (left, center, right) with any combination of navigation commands. Each command can have custom text: prev/next for month navigation, prevYear/nextYear for year navigation, today for the "jump to today" button, and month/week/day for the view switcher buttons.

Git History

CommitWhat changed
868d6abb7 through ceb63e8a1Six annual copyright header updates. The DTO's field list and fluent API have remained unchanged — the FullCalendar button label model accurately represents all button positions the JavaScript library supports, and no additional buttons have been needed.