Class Schedule
java.lang.Object
com.jbstrap.ui.components.calendar.Schedule
Calendar scheduled event, used by the
Calendar
component- Since:
- 4.0
- Author:
- JBStrap
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddAttendee
(String attendee) Adds an attendee to the scheduled eventaddAttendees
(String... attendees) Adds multiple attendees to the scheduled eventGets a list of the attendeesgetBody()
Gets the body (description) of the scheduled eventprotected com.jbstrap.ui.components.calendar.CalendarElement
Gets the instance of the calendar, that is assigned to the Scheduled event object.Gets the name of the calendar, that has the scheduled event assigned to itGets the coming duration (the amount of times it takes to come back from the event)Gets the end date of the scheduled eventGets the unique ID of the scheduled eventGets the going duration (the amount of times it takes to go to the event)Gets the location of the scheduled eventGets the scheduled event's database recordGets the start date of the scheduled eventgetTitle()
Gets the title of the scheduled eventgetType()
Gets the type of the scheduled eventboolean
isAllDay()
Determines if the scheduled event is an all-day event.boolean
Determines if the scheduled event is pending.boolean
Determines if the scheduled event is private.boolean
Determines if the scheduled event is read-onlyboolean
Determines if the scheduled event is visible.Removes every attendee from the scheduled eventremoveAttendee
(String attendee) Removes an attendee from the scheduled eventSets the body (description) of the scheduled eventprotected Schedule
setCalendar
(com.jbstrap.ui.components.calendar.CalendarElement calendar) Sets the scheduled event's calendarsetComingDuration
(Long duration) Sets the coming duration (the amount of times it takes to come back from the event)setEndDate
(Date endDate) Sets the end date of the scheduled eventsetGoingDuration
(Long duration) Sets the going duration (the amount of times it takes to go to the event)Sets the unique ID of the scheduled eventsetLocation
(String location) Sets the location of the scheduled eventsetPending
(boolean pending) Sets the scheduled event as pending.setPrivate
(boolean privateFlag) Sets the scheduled event as private.setReadOnly
(boolean readOnly) Sets the scheduled event as read-only.protected Schedule
Sets the Scheduled Event's database recordsetStartDate
(Date startDate) Sets the start date of the scheduled eventSets the title of the scheduled eventsetType
(ScheduleType type) Sets the type of the scheduled eventsetVisible
(boolean visible) Sets if the scheduled event is visible.
-
Constructor Details
-
Schedule
public Schedule()Creates a calendar scheduled event
-
-
Method Details
-
setCalendar
Sets the scheduled event's calendar- Parameters:
calendar
- The instance of the calendar component, which will have schedule set to it- Returns:
- The Schedule object
-
getEventID
Gets the unique ID of the scheduled event- Returns:
- The unique ID of the scheduled event
-
setId
Sets the unique ID of the scheduled event- Parameters:
id
- The unique ID of the scheduled event- Returns:
- The schedule object
-
getCalendarName
Gets the name of the calendar, that has the scheduled event assigned to it- Returns:
- The name of the calendar, or
null
, if it was not specified
-
getCalendar
protected com.jbstrap.ui.components.calendar.CalendarElement getCalendar()Gets the instance of the calendar, that is assigned to the Scheduled event object.- Returns:
- The calendar instance of the scheduled event, or
null
if it isn't assigned to any calendar component
-
setTitle
Sets the title of the scheduled event- Parameters:
title
- The title of the scheduled event. Ifnull
, no title will be used- Returns:
- The schedule object
-
getTitle
Gets the title of the scheduled event- Returns:
- The title or
null
, if it has none
-
setBody
Sets the body (description) of the scheduled event- Parameters:
body
- The description of the event. Ifnull
, it will not have a description.- Returns:
- The schedule object
-
getBody
Gets the body (description) of the scheduled event- Returns:
- The description of the event. Or
null
, if it has no description.
-
setStartDate
Sets the start date of the scheduled event- Parameters:
startDate
- The start date of the scheduled event- Returns:
- The schedule object
- Throws:
NullPointerException
- If the start date isnull
-
getStartDate
Gets the start date of the scheduled event- Returns:
- The starting date of the scheduled event or
null
, if it has none
-
setEndDate
Sets the end date of the scheduled event- Parameters:
endDate
- The end date of the scheduled event- Returns:
- The schedule object
- Throws:
NullPointerException
- If the end date isnull
-
getEndDate
Gets the end date of the scheduled event- Returns:
- The ending date of the scheduled event or
null
, if it has none
-
setComingDuration
Sets the coming duration (the amount of times it takes to come back from the event)- Parameters:
duration
- The duration, in minutes- Returns:
- The schedule object
-
getComingDuration
Gets the coming duration (the amount of times it takes to come back from the event)- Returns:
- The duration, in minutes, or
null
if it was not specified
-
setGoingDuration
Sets the going duration (the amount of times it takes to go to the event)- Parameters:
duration
- The duration, in minutes- Returns:
- The schedule object
-
getGoingDuration
Gets the going duration (the amount of times it takes to go to the event)- Returns:
- The duration, in minutes, or
null
if it was not specified
-
setType
Sets the type of the scheduled event- Parameters:
type
- The event type. The usable values can be found in theScheduleType
enum.- Returns:
- The schedule object
- Throws:
NullPointerException
- If the type isnull
-
getType
Gets the type of the scheduled event- Returns:
- The event type or
null
if it was not specified
-
isAllDay
public boolean isAllDay()Determines if the scheduled event is an all-day event.- Returns:
- If
true
, it is, otherwise not.
-
setLocation
Sets the location of the scheduled event- Parameters:
location
- The location of the event- Returns:
- The schedule object
-
getLocation
Gets the location of the scheduled event- Returns:
- The location or
null
if not specified
-
addAttendee
Adds an attendee to the scheduled event- Parameters:
attendee
- The new attendee- Returns:
- The schedule object
-
addAttendees
Adds multiple attendees to the scheduled event- Parameters:
attendees
- The new attendees- Returns:
- The schedule object
-
removeAttendee
Removes an attendee from the scheduled event- Parameters:
attendee
- The attendee to be removed- Returns:
- The schedule object
-
removeAllAttendees
Removes every attendee from the scheduled event- Returns:
- The schedule object
-
getAttendees
Gets a list of the attendees- Returns:
- A list containing every attendee, or
null
, if no attendees were specified
-
setPending
Sets the scheduled event as pending. By default, it is not.- Parameters:
pending
- Iftrue
, the scheduled event will be marked as pending- Returns:
- The schedule object
-
isPending
public boolean isPending()Determines if the scheduled event is pending.- Returns:
- If
true
, the event is pending.
-
setReadOnly
Sets the scheduled event as read-only. By default, this is false, meaning that the user can modify/move it.- Parameters:
readOnly
- Iftrue
the scheduled event is read-only.- Returns:
- The schedule object
-
isReadOnly
public boolean isReadOnly()Determines if the scheduled event is read-only- Returns:
- If
true
, the scheduled event is read-only
-
setPrivate
Sets the scheduled event as private. By default, the event is not private.- Parameters:
privateFlag
- Iftrue
, the scheduled event is marked as private, otherwise not- Returns:
- The schedule object
-
isPrivate
public boolean isPrivate()Determines if the scheduled event is private.- Returns:
- If
true
, the scheduled event is marked as private, otherwise not
-
setVisible
Sets if the scheduled event is visible. By default it is visible.- Parameters:
visible
- Iftrue
, the scheduled event is visible on the component. Iffalse
it will not be displayed- Returns:
- The schedule object
-
isVisible
public boolean isVisible()Determines if the scheduled event is visible.- Returns:
- If
true
, the scheduled event is visible on the component
-
setRecord
Sets the Scheduled Event's database record- Parameters:
record
- The database record- Returns:
- The schedule object
-
getRecord
Gets the scheduled event's database record- Returns:
- The record, or
null
, if it was not set
-