Top Description Fields Constructors Methods
com.calendarfx.model

public Class Resource<T>

extends Object
Class Inheritance
Type Parameters
<T>
the type of the wrapped / referenced business object (person or machine).
Imports
com.calendarfx.view.DateControl, .Messages, .ResourcesView, javafx.beans.InvalidationListener, .Observable, .WeakInvalidationListener, javafx.beans.property.ObjectProperty, .ReadOnlyListProperty, .ReadOnlyListWrapper, .SimpleObjectProperty, javafx.collections.FXCollections, .ObservableList, java.util.ArrayList, .List

A resource represents a person or a machine. Resources can be edited via the ResourcesView. A typical use case would be the allocation of personnel in a hairdresser salon. A resource might be available or not. This can be expressed via the availabilityCalendarProperty().
See Also
ResourcesView#getResources(), DateControl#editAvailabilityProperty(), DateControl#availabilityGridProperty(), DateControl#availabilityFillProperty()

Field Summary

Modifier and TypeField and Description
public final ObjectProperty<Calendar<T>>
private final ReadOnlyListWrapper<Calendar<T>>
private final ObservableList<CalendarSource>
private final ObservableList<Calendar<T>>
private final InvalidationListener
private final ObjectProperty<T>
private final WeakInvalidationListener

Constructor Summary

AccessConstructor and Description
public
public
Resource(T userObject)

Method Summary

Modifier and TypeMethod and Description
public ObjectProperty<Calendar<T>>

Returns:

the resource's availability calendar
availabilityCalendarProperty
()

A resource might be available or not.

public final ReadOnlyListProperty<Calendar<T>>

Returns:

the list of all calendars available for this resource
calendarsProperty
()

A list that contains all calendars found in all calendar sources currently attached to this resource.

public Calendar<T>
public final ObservableList<Calendar<T>>

Returns:

the list of all calendars available for this control
getCalendars
()

Returns the value of calendarsProperty().

public final ObservableList<CalendarSource>

Returns:

the calendar sources
getCalendarSources
()

The list of all calendar sources attached to this resource.

public final T
public void
setAvailabilityCalendar(Calendar<T> availabilityCalendar)

public final void
setUserObject(T userObject)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

private void
public final ObjectProperty<T>

Returns:

the user object (e.g. the person or the calendar data source).
userObjectProperty
()

An (optional) user object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

availabilityCalendarback to summary
public final ObjectProperty<Calendar<T>> availabilityCalendar
calendarsback to summary
private final ReadOnlyListWrapper<Calendar<T>> calendars
calendarSourcesback to summary
private final ObservableList<CalendarSource> calendarSources
unmodifiableCalendarsback to summary
private final ObservableList<Calendar<T>> unmodifiableCalendars
updateCalendarListListenerback to summary
private final InvalidationListener updateCalendarListListener
userObjectback to summary
private final ObjectProperty<T> userObject
weakUpdateCalendarListListenerback to summary
private final WeakInvalidationListener weakUpdateCalendarListListener

Constructor Detail

Resourceback to summary
public Resource()
Resourceback to summary
public Resource(T userObject)

Method Detail

availabilityCalendarPropertyback to summary
public ObjectProperty<Calendar<T>> availabilityCalendarProperty()

A resource might be available or not. This can be determined via the "availability" calendar.

Returns:ObjectProperty<Calendar<T>>

the resource's availability calendar

See Also
DateControl#editAvailabilityProperty(), DateControl#availabilityGridProperty(), DateControl#availabilityFillProperty()
calendarsPropertyback to summary
public final ReadOnlyListProperty<Calendar<T>> calendarsProperty()

A list that contains all calendars found in all calendar sources currently attached to this resource. This is a convenience list that "flattens" the two level structure of sources and their calendars. It is a read-only list because calendars can not be added directly to a resource. Instead, they are added to calendar sources and those sources are then added to the control.

Returns:ReadOnlyListProperty<Calendar<T>>

the list of all calendars available for this resource

See Also
getCalendarSources()
getAvailabilityCalendarback to summary
public Calendar<T> getAvailabilityCalendar()
getCalendarsback to summary
public final ObservableList<Calendar<T>> getCalendars()

Returns the value of calendarsProperty().

Returns:ObservableList<Calendar<T>>

the list of all calendars available for this control

getCalendarSourcesback to summary
public final ObservableList<CalendarSource> getCalendarSources()

The list of all calendar sources attached to this resource.

Returns:ObservableList<CalendarSource>

the calendar sources

See Also
DateControl#getCalendarSources()
getUserObjectback to summary
public final T getUserObject()
setAvailabilityCalendarback to summary
public void setAvailabilityCalendar(Calendar<T> availabilityCalendar)
setUserObjectback to summary
public final void setUserObject(T userObject)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
updateCalendarListback to summary
private void updateCalendarList()
userObjectPropertyback to summary
public final ObjectProperty<T> userObjectProperty()

An (optional) user object.

Returns:ObjectProperty<T>

the user object (e.g. the person or the calendar data source).