T
- the type of the user objectpublic class Entry<T> extends Object implements Comparable<Entry<?>>
DayEntryView
inside a DayView
.
setRecurrenceRule(String)
must be fed with a valid RRULE string, for example "RRULE:FREQ=DAILY" for an
event that occures every day. The calendar to which the entry belongs is then
responsible for creating the recurring entries when its
Calendar.findEntries(LocalDate, LocalDate, ZoneId)
method gets
invoked. Recurring entries will return "true" when their
isRecurrence()
method is called and they will also be able to return
the "source" entry (getRecurrenceSourceEntry()
).
Entry entry = new Entry("Dentist Appointment"); Interval interval = new Interval(...); entry.setInterval(interval); entry.setRecurrenceRule("RRULE:FREQ=DAILY;INTERVAL=2;"); Calendar calendar = new Calendar("Health"); calendar.addEntry(entry);
Type | Property and Description |
---|---|
ObjectProperty<Calendar> |
calendar
A property used to store a reference to the calendar that owns the entry.
|
ReadOnlyObjectProperty<LocalDate> |
endDate
A read-only property used for retrieving the end date of the entry.
|
ReadOnlyObjectProperty<LocalTime> |
endTime
A read-only property used for retrieving the end time of the entry.
|
BooleanProperty |
fullDay
A property used to signal whether an entry is considered to be a
"full day" entry, for example a birthday.
|
ObjectProperty<Interval> |
interval
A property used to store the time interval occupied by this entry.
|
StringProperty |
location
A property used to store a free-text location specification for the given
entry.
|
ObjectProperty<Duration> |
minimumDuration
A property used to store the minimum duration an entry can have.
|
ReadOnlyBooleanProperty |
multiDay
A read-only property to determine if the entry spans several days.
|
ReadOnlyObjectProperty<LocalDate> |
recurrenceEnd
The property used to store the end time of the recurrence rule.
|
ReadOnlyStringProperty |
recurrenceId
Stores the recurrence ID which is being generated on-the-fly by the
Calendar to which the recurrence source entry belongs. |
ReadOnlyBooleanProperty |
recurrence
A read-only property used to indicate whether the entry is a recurrence
copy of a recurrence source.
|
StringProperty |
recurrenceRule
A property used to store a recurrence rule according to RFC-2445.
|
ReadOnlyObjectProperty<Entry<T>> |
recurrenceSource
If the entry is a recurrence (see
recurrenceProperty() ) then
this property will store a reference to the entry for which the
recurrence was created. |
ReadOnlyObjectProperty<LocalDate> |
startDate
A read-only property used for retrieving the start date of the entry.
|
ReadOnlyObjectProperty<LocalTime> |
startTime
A read-only property used for retrieving the start time of the entry.
|
StringProperty |
title
A property used to store the title of the entry.
|
ObjectProperty<T> |
userObject
A property used to store a reference to an optional user object.
|
ReadOnlyObjectProperty<ZoneId> |
zoneId
A property used to store a time zone for the entry.
|
Constructor and Description |
---|
Entry()
Constructs a new untitled entry.
|
Entry(String title)
Constructs a new entry with the given title and a default time interval.
|
Entry(String title,
Interval interval)
Constructs a new entry with the given title.
|
Modifier and Type | Method and Description |
---|---|
ObjectProperty<Calendar> |
calendarProperty()
A property used to store a reference to the calendar that owns the entry.
|
void |
changeEndDate(LocalDate date)
Changes the end date of the entry interval and ensures that the entry's interval
stays valid, which means that the start time will be before the end time and that the
duration of the entry will be at least the duration defined by the
minimumDurationProperty() . |
void |
changeEndDate(LocalDate date,
boolean keepDuration)
Changes the end date of the entry interval.
|
void |
changeEndTime(LocalTime time)
Changes the end time of the entry interval and ensures that the entry's interval
stays valid, which means that the start time will be before the end time and that the
duration of the entry will be at least the duration defined by the
minimumDurationProperty() . |
void |
changeEndTime(LocalTime time,
boolean keepDuration)
Changes the end time of the entry interval.
|
void |
changeStartDate(LocalDate date)
Changes the start date of the entry interval and ensures that the entry's interval
stays valid, which means that the start time will be before the end time and that the
duration of the entry will be at least the duration defined by the
minimumDurationProperty() . |
void |
changeStartDate(LocalDate date,
boolean keepDuration)
Changes the start date of the entry interval.
|
void |
changeStartTime(LocalTime time)
Changes the start time of the entry interval and ensures that the entry's interval
stays valid, which means that the start time will be before the end time and that the
duration of the entry will be at least the duration defined by the
minimumDurationProperty() . |
void |
changeStartTime(LocalTime time,
boolean keepDuration)
Changes the start time of the entry interval.
|
int |
compareTo(Entry<?> other) |
Entry<T> |
createRecurrence()
If the entry defines a recurrence rule (see
recurrenceRuleProperty() ) then the calendar will use this method
to create one or more "copies" of the entry. |
ReadOnlyObjectProperty<LocalDate> |
endDateProperty()
A read-only property used for retrieving the end date of the entry.
|
ReadOnlyObjectProperty<LocalTime> |
endTimeProperty()
A read-only property used for retrieving the end time of the entry.
|
boolean |
equals(Object obj) |
BooleanProperty |
fullDayProperty()
A property used to signal whether an entry is considered to be a
"full day" entry, for example a birthday.
|
Calendar |
getCalendar()
Returns the value of
calendarProperty() . |
Duration |
getDuration()
Utility method to calculate the duration of the entry.
|
LocalDateTime |
getEndAsLocalDateTime()
Utility method to get the local end date time.
|
ZonedDateTime |
getEndAsZonedDateTime()
Utility method to get the zoned end time.
|
LocalDate |
getEndDate()
Returns the end date of the entry's interval (see
intervalProperty() ). |
long |
getEndMillis()
Returns the end time in milliseconds since 1.1.1970.
|
LocalTime |
getEndTime()
Returns the end time of the entry's interval (see
intervalProperty() ). |
String |
getId()
Returns the ID of the entry.
|
Interval |
getInterval()
Returns the value of
intervalProperty() . |
String |
getLocation()
Returns the value of
locationProperty() . |
Duration |
getMinimumDuration()
Returns the value of
minimumDurationProperty() . |
ObservableMap<Object,Object> |
getProperties()
Returns an observable map of properties on this entry for use primarily
by application developers.
|
ObservableList<org.controlsfx.control.PropertySheet.Item> |
getPropertySheetItems() |
LocalDate |
getRecurrenceEnd()
Returns the value of
recurrenceRuleProperty() . |
String |
getRecurrenceId()
Returns the value of
recurrenceIdProperty() . |
String |
getRecurrenceRule()
Returns the value of
recurrenceRuleProperty() . |
Entry<T> |
getRecurrenceSourceEntry()
Returns the value of
recurrenceSourceProperty() . |
LocalDateTime |
getStartAsLocalDateTime()
Utility method to get the local start date time.
|
ZonedDateTime |
getStartAsZonedDateTime()
Utility method to get the zoned start time.
|
LocalDate |
getStartDate()
Returns the start date of the entry's interval (see
intervalProperty() ). |
long |
getStartMillis()
Returns the start time in milliseconds since 1.1.1970.
|
LocalTime |
getStartTime()
Returns the start time of the entry's interval (see
intervalProperty() ). |
ObservableList<String> |
getStyleClass()
Returns a list of style classes.
|
String |
getTitle()
Returns the value of
titleProperty() . |
T |
getUserObject()
Returns the value of
userObjectProperty() . |
ZoneId |
getZoneId()
Returns the value of
zoneIdProperty() . |
int |
hashCode() |
boolean |
hasProperties()
Tests if the entry has properties.
|
boolean |
hasStyleClass()
Checks whether the entry has defined any custom styles at all.
|
boolean |
intersects(Entry<?> entry)
Utility method to determine if this entry and the given entry intersect
each other (time bounds overlap each other).
|
boolean |
intersects(ZonedDateTime startTime,
ZonedDateTime endTime)
Utility method to determine if this entry and the given time interval
intersect each other (time bounds overlap each other).
|
ObjectProperty<Interval> |
intervalProperty()
A property used to store the time interval occupied by this entry.
|
boolean |
isFullDay()
Returns the value of
fullDayProperty() . |
boolean |
isMultiDay()
Returns the value of
multiDayProperty() . |
boolean |
isRecurrence()
Returns the value of
recurrenceProperty() . |
boolean |
isRecurring()
Determines if the entry describes a recurring event.
|
boolean |
isShowing(LocalDate startDate,
LocalDate endDate,
ZoneId zoneId)
Checks whether the entry will be visible within the given start and end dates.
|
StringProperty |
locationProperty()
A property used to store a free-text location specification for the given
entry.
|
boolean |
matches(String searchTerm)
Used by the
Calendar.findEntries(String) to find entries based on
a text search. |
ObjectProperty<Duration> |
minimumDurationProperty()
A property used to store the minimum duration an entry can have.
|
ReadOnlyBooleanProperty |
multiDayProperty()
A read-only property to determine if the entry spans several days.
|
ReadOnlyObjectProperty<LocalDate> |
recurrenceEndProperty()
The property used to store the end time of the recurrence rule.
|
ReadOnlyStringProperty |
recurrenceIdProperty()
Stores the recurrence ID which is being generated on-the-fly by the
Calendar to which the recurrence source entry belongs. |
ReadOnlyBooleanProperty |
recurrenceProperty()
A read-only property used to indicate whether the entry is a recurrence
copy of a recurrence source.
|
StringProperty |
recurrenceRuleProperty()
A property used to store a recurrence rule according to RFC-2445.
|
ReadOnlyObjectProperty<Entry<T>> |
recurrenceSourceProperty()
If the entry is a recurrence (see
recurrenceProperty() ) then
this property will store a reference to the entry for which the
recurrence was created. |
void |
removeFromCalendar()
A convenience method to easily remove the entry from its calendar.
|
void |
setCalendar(Calendar cal)
Sets the value of
calendarProperty() . |
void |
setFullDay(boolean fullDay)
Sets the value of
fullDayProperty() . |
void |
setId(String id)
Assigns a new ID to the entry.
|
void |
setInterval(Interval interval)
Sets the value of
intervalProperty() . |
void |
setInterval(LocalDate date) |
void |
setInterval(LocalDate startDate,
LocalDate endDate) |
void |
setInterval(LocalDate startDate,
LocalDate endDate,
ZoneId zoneId) |
void |
setInterval(LocalDate startDate,
LocalTime startTime,
LocalDate endDate,
LocalTime endTime) |
void |
setInterval(LocalDate startDate,
LocalTime startTime,
LocalDate endDate,
LocalTime endTime,
ZoneId zoneId) |
void |
setInterval(LocalDateTime dateTime) |
void |
setInterval(LocalDateTime startDateTime,
LocalDateTime endDateTime) |
void |
setInterval(LocalDateTime startDateTime,
LocalDateTime endDateTime,
ZoneId zoneId) |
void |
setInterval(LocalDateTime dateTime,
ZoneId zoneId) |
void |
setInterval(LocalDate date,
ZoneId zoneId) |
void |
setInterval(LocalTime startTime,
LocalTime endTime) |
void |
setInterval(LocalTime startTime,
LocalTime endTime,
ZoneId zoneId) |
void |
setInterval(ZonedDateTime date) |
void |
setInterval(ZonedDateTime startDate,
ZonedDateTime endDate) |
void |
setLocation(String loc)
Sets the value of
locationProperty() . |
void |
setMinimumDuration(Duration duration)
Sets the value of
minimumDurationProperty() . |
void |
setRecurrenceRule(String rec)
Sets the value of
recurrenceRuleProperty() . |
void |
setTitle(String title)
Sets the value of
titleProperty() . |
void |
setUserObject(T object)
Sets the value of
userObjectProperty() . |
void |
setZoneId(ZoneId zoneId)
Sets the value of
zoneIdProperty() . |
ReadOnlyObjectProperty<LocalDate> |
startDateProperty()
A read-only property used for retrieving the start date of the entry.
|
ReadOnlyObjectProperty<LocalTime> |
startTimeProperty()
A read-only property used for retrieving the start time of the entry.
|
StringProperty |
titleProperty()
A property used to store the title of the entry.
|
String |
toString() |
ObjectProperty<T> |
userObjectProperty()
A property used to store a reference to an optional user object.
|
ReadOnlyObjectProperty<ZoneId> |
zoneIdProperty()
A property used to store a time zone for the entry.
|
public final ObjectProperty<Interval> intervalProperty
startDateProperty()
,
endDateProperty()
, startTimeProperty()
,
endTimeProperty()
, zoneIdProperty()
, and
multiDayProperty()
.getInterval()
,
setInterval(Interval)
public final ReadOnlyObjectProperty<Entry<T>> recurrenceSourceProperty
recurrenceProperty()
) then
this property will store a reference to the entry for which the
recurrence was created.public final ReadOnlyBooleanProperty recurrenceProperty
recurrenceSourceProperty()
gets initialized with a
value other than null.isRecurrence()
public final StringProperty recurrenceRuleProperty
String rrule = "RRULE:FREQ=DAILY;INTERVAL=2;UNTIL=20150901"; setRecurrenceRule(rrule);
getRecurrenceRule()
,
setRecurrenceRule(String)
public final ReadOnlyStringProperty recurrenceIdProperty
Calendar
to which the recurrence source entry belongs.getRecurrenceId()
public final ReadOnlyObjectProperty<LocalDate> recurrenceEndProperty
getRecurrenceEnd()
public final ObjectProperty<Calendar> calendarProperty
getCalendar()
,
setCalendar(Calendar)
public final ObjectProperty<T> userObjectProperty
getUserObject()
,
setUserObject(T)
public final ReadOnlyObjectProperty<ZoneId> zoneIdProperty
getZoneId()
,
setZoneId(ZoneId)
public final StringProperty titleProperty
getTitle()
,
setTitle(String)
public final StringProperty locationProperty
getLocation()
,
setLocation(String)
public final ReadOnlyObjectProperty<LocalDate> startDateProperty
intervalProperty()
).getStartDate()
public final ReadOnlyObjectProperty<LocalTime> startTimeProperty
intervalProperty()
).getStartTime()
public final ReadOnlyObjectProperty<LocalDate> endDateProperty
intervalProperty()
).getEndDate()
public final ReadOnlyObjectProperty<LocalTime> endTimeProperty
intervalProperty()
).getEndTime()
public final BooleanProperty fullDayProperty
isFullDay()
,
setFullDay(boolean)
public final ObjectProperty<Duration> minimumDurationProperty
Duration.ZERO
to allow
zero duration entries.getMinimumDuration()
,
setMinimumDuration(Duration)
public final ReadOnlyBooleanProperty multiDayProperty
isMultiDay()
public Entry()
public Entry(String title)
title
- the title shown to the userpublic final ObservableMap<Object,Object> getProperties()
public final boolean hasProperties()
public final boolean hasStyleClass()
getStyleClass()
directly as
it does not instantiate the lazily created style class list if it doesn't
exist, yet.public final ObservableList<String> getStyleClass()
public final ObjectProperty<Interval> intervalProperty()
startDateProperty()
,
endDateProperty()
, startTimeProperty()
,
endTimeProperty()
, zoneIdProperty()
, and
multiDayProperty()
.getInterval()
,
setInterval(Interval)
public final Interval getInterval()
intervalProperty()
.public final void setInterval(Interval interval)
intervalProperty()
.interval
- the new time interval used by the entrypublic final void setInterval(LocalDate date)
public final void setInterval(LocalDate startDate, LocalTime startTime, LocalDate endDate, LocalTime endTime)
public final void setInterval(LocalDate startDate, LocalTime startTime, LocalDate endDate, LocalTime endTime, ZoneId zoneId)
public final void setInterval(LocalDateTime dateTime)
public final void setInterval(LocalDateTime dateTime, ZoneId zoneId)
public final void setInterval(LocalDateTime startDateTime, LocalDateTime endDateTime)
public final void setInterval(LocalDateTime startDateTime, LocalDateTime endDateTime, ZoneId zoneId)
public final void setInterval(ZonedDateTime date)
public final void setInterval(ZonedDateTime startDate, ZonedDateTime endDate)
public final void changeStartDate(LocalDate date)
minimumDurationProperty()
.date
- the new start datepublic final void changeStartDate(LocalDate date, boolean keepDuration)
date
- the new start datekeepDuration
- if true then this method will also change the end date and time in such a way that the total duration
of the entry will not change. If false then this method will ensure that the entry's interval
stays valid, which means that the start time will be before the end time and that the
duration of the entry will be at least the duration defined by the minimumDurationProperty()
.public final void changeStartTime(LocalTime time)
minimumDurationProperty()
.time
- the new start timepublic final void changeStartTime(LocalTime time, boolean keepDuration)
time
- the new start timekeepDuration
- if true then this method will also change the end time in such a way that the total duration
of the entry will not change. If false then this method will ensure that the entry's interval
stays valid, which means that the start time will be before the end time and that the
duration of the entry will be at least the duration defined by the minimumDurationProperty()
.public final void changeEndDate(LocalDate date)
minimumDurationProperty()
.date
- the new end datepublic final void changeEndDate(LocalDate date, boolean keepDuration)
date
- the new end datekeepDuration
- if true then this method will also change the start date and time in such a way that the total duration
of the entry will not change. If false then this method will ensure that the entry's interval
stays valid, which means that the start time will be before the end time and that the
duration of the entry will be at least the duration defined by the minimumDurationProperty()
.public final void changeEndTime(LocalTime time)
minimumDurationProperty()
.time
- the new end timepublic final void changeEndTime(LocalTime time, boolean keepDuration)
time
- the new end timekeepDuration
- if true then this method will also change the start time in such a way that the total duration
of the entry will not change. If false then this method will ensure that the entry's interval
stays valid, which means that the start time will be before the end time and that the
duration of the entry will be at least the duration defined by the minimumDurationProperty()
.public final ReadOnlyObjectProperty<Entry<T>> recurrenceSourceProperty()
recurrenceProperty()
) then
this property will store a reference to the entry for which the
recurrence was created.public final Entry<T> getRecurrenceSourceEntry()
recurrenceSourceProperty()
.public Entry<T> createRecurrence()
recurrenceRuleProperty()
) then the calendar will use this method
to create one or more "copies" of the entry. The default implementation
of this method will simply create a new instance of type Entry
.
The initialization of the standard fields (e.g. "Interval" or "Title") of
the recurrence copy will be done by the calendar. Subclasses should
override this method to also initialize additional fields.public final ReadOnlyBooleanProperty recurrenceProperty()
recurrenceSourceProperty()
gets initialized with a
value other than null.isRecurrence()
public final boolean isRecurrence()
recurrenceProperty()
.public final boolean isRecurring()
recurrenceRuleProperty()
public final StringProperty recurrenceRuleProperty()
String rrule = "RRULE:FREQ=DAILY;INTERVAL=2;UNTIL=20150901"; setRecurrenceRule(rrule);
getRecurrenceRule()
,
setRecurrenceRule(String)
public final void setRecurrenceRule(String rec)
recurrenceRuleProperty()
.rec
- the new recurrence rulepublic final String getRecurrenceRule()
recurrenceRuleProperty()
.public final ReadOnlyStringProperty recurrenceIdProperty()
Calendar
to which the recurrence source entry belongs.getRecurrenceId()
public final String getRecurrenceId()
recurrenceIdProperty()
.public final ReadOnlyObjectProperty<LocalDate> recurrenceEndProperty()
getRecurrenceEnd()
public final LocalDate getRecurrenceEnd()
recurrenceRuleProperty()
.public final void setId(String id)
id
- the new ID of the entrypublic final String getId()
public final ObjectProperty<Calendar> calendarProperty()
getCalendar()
,
setCalendar(Calendar)
public final void setCalendar(Calendar cal)
calendarProperty()
.cal
- the new owning calendar of this entrypublic final Calendar getCalendar()
calendarProperty()
.public final void removeFromCalendar()
setCalendar(Calendar)
and passes a null value.public final ObjectProperty<T> userObjectProperty()
getUserObject()
,
setUserObject(T)
public final void setUserObject(T object)
userObjectProperty()
.object
- the new user objectpublic final T getUserObject()
userObjectProperty()
.public final ReadOnlyObjectProperty<ZoneId> zoneIdProperty()
getZoneId()
,
setZoneId(ZoneId)
public final void setZoneId(ZoneId zoneId)
zoneIdProperty()
.zoneId
- the new time zone to use for this entrypublic final ZoneId getZoneId()
zoneIdProperty()
.public final StringProperty titleProperty()
getTitle()
,
setTitle(String)
public final void setTitle(String title)
titleProperty()
.title
- the title shown by the entrypublic final String getTitle()
titleProperty()
.public final StringProperty locationProperty()
getLocation()
,
setLocation(String)
public final void setLocation(String loc)
locationProperty()
.loc
- the new locationpublic final String getLocation()
locationProperty()
.public final ReadOnlyObjectProperty<LocalDate> startDateProperty()
intervalProperty()
).getStartDate()
public final LocalDate getStartDate()
intervalProperty()
).public final ReadOnlyObjectProperty<LocalTime> startTimeProperty()
intervalProperty()
).getStartTime()
public final LocalTime getStartTime()
intervalProperty()
).public final ReadOnlyObjectProperty<LocalDate> endDateProperty()
intervalProperty()
).getEndDate()
public final LocalDate getEndDate()
intervalProperty()
).public final ReadOnlyObjectProperty<LocalTime> endTimeProperty()
intervalProperty()
).getEndTime()
public final LocalTime getEndTime()
intervalProperty()
).public final BooleanProperty fullDayProperty()
isFullDay()
,
setFullDay(boolean)
public final boolean isFullDay()
fullDayProperty()
.public final void setFullDay(boolean fullDay)
fullDayProperty()
.fullDay
- true if entry is a full day entry, e.g. a birthdaypublic final ObjectProperty<Duration> minimumDurationProperty()
Duration.ZERO
to allow
zero duration entries.getMinimumDuration()
,
setMinimumDuration(Duration)
public final Duration getMinimumDuration()
minimumDurationProperty()
.public final void setMinimumDuration(Duration duration)
minimumDurationProperty()
.duration
- the minimum durationpublic boolean matches(String searchTerm)
Calendar.findEntries(String)
to find entries based on
a text search. This method can be overriden. The default implementation
compares the given text with the title of the entry (lower case
comparison).searchTerm
- the search termpublic final ZonedDateTime getStartAsZonedDateTime()
getStartDate()
,
getStartTime()
,
getZoneId()
public final long getStartMillis()
public final LocalDateTime getStartAsLocalDateTime()
getStartDate()
,
getStartTime()
public final ZonedDateTime getEndAsZonedDateTime()
getEndDate()
,
getEndTime()
,
getZoneId()
public final long getEndMillis()
public final LocalDateTime getEndAsLocalDateTime()
getEndDate()
,
getEndTime()
public final ReadOnlyBooleanProperty multiDayProperty()
isMultiDay()
public final boolean isMultiDay()
multiDayProperty()
.public final boolean intersects(Entry<?> entry)
entry
- the other entry to checkpublic final boolean intersects(ZonedDateTime startTime, ZonedDateTime endTime)
startTime
- time interval startendTime
- time interval endpublic final Duration getDuration()
getStartAsZonedDateTime()
,
getEndAsZonedDateTime()
public final boolean isShowing(LocalDate startDate, LocalDate endDate, ZoneId zoneId)
startDate
- the start date of the search intervalendDate
- the end date of the search intervalzoneId
- the time zonepublic final int compareTo(Entry<?> other)
compareTo
in interface Comparable<Entry<?>>
public ObservableList<org.controlsfx.control.PropertySheet.Item> getPropertySheetItems()
Copyright © 2017 Dirk Lemmermann Software & Consulting. All rights reserved.