Class CalendarEvent
- java.lang.Object
-
- com.vaadin.client.ui.calendar.schedule.CalendarEvent
-
public class CalendarEvent extends Object
A client side implementation of a calendar event- Since:
- 7.1
- Author:
- Vaadin Ltd.
-
-
Constructor Summary
Constructors Constructor Description CalendarEvent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getCaption()
Get the caption of the event.String
getDescription()
Get the description of the event.Date
getEnd()
Date
getEndTime()
Get the end time of the eventint
getIndex()
Get the (server side) index of the eventlong
getRangeInMilliseconds()
Get the amount of milliseconds between the start and end of the eventlong
getRangeInMinutes()
Get the amount of minutes between the start and end of the eventlong
getRangeInMinutesForDay(Date targetDay)
Get the amount of minutes for the event on a specific day.int
getSlotIndex()
Get the index of the slot where the event in renderedDate
getStart()
Date
getStartTime()
Returns the start time of the eventString
getStyleName()
String
getTimeAsText()
Get the time as a formatted stringboolean
isAllDay()
Is the event an all day event.boolean
isTimeOnDifferentDays()
Does the event span several daysvoid
setAllDay(boolean allDay)
Is the event an all day event.void
setCaption(String caption)
Set the caption of the event.void
setDescription(String description)
Set the description of the event.void
setEnd(Date end)
void
setEndTime(Date endTime)
Set the end time of the eventvoid
setFormat24h(boolean format24h)
Does the event use the 24h time formatvoid
setIndex(int index)
Set the (server side) index of the eventvoid
setSlotIndex(int index)
Set the index of the slot where the event in renderedvoid
setStart(Date start)
void
setStartTime(Date startTime)
Set the start time of the eventvoid
setStyleName(String style)
-
-
-
Method Detail
-
getStyleName
public String getStyleName()
- See Also:
com.vaadin.addon.calendar.event.CalendarEvent#getStyleName()
-
getStart
public Date getStart()
- See Also:
com.vaadin.addon.calendar.event.CalendarEvent#getStart()
-
setStyleName
public void setStyleName(String style)
- Parameters:
style
-- See Also:
com.vaadin.addon.calendar.event.CalendarEvent#getStyleName()
-
setStart
public void setStart(Date start)
- Parameters:
start
-- See Also:
com.vaadin.addon.calendar.event.CalendarEvent#getStart()
-
getEnd
public Date getEnd()
- Returns:
- See Also:
com.vaadin.addon.calendar.event.CalendarEvent#getEnd()
-
setEnd
public void setEnd(Date end)
- Parameters:
end
-- See Also:
com.vaadin.addon.calendar.event.CalendarEvent#getEnd()
-
getStartTime
public Date getStartTime()
Returns the start time of the event- Returns:
- Time embedded in the
Date
object
-
setStartTime
public void setStartTime(Date startTime)
Set the start time of the event- Parameters:
startTime
- The time of the event. Use the time fields in theDate
object
-
getEndTime
public Date getEndTime()
Get the end time of the event- Returns:
- Time embedded in the
Date
object
-
setEndTime
public void setEndTime(Date endTime)
Set the end time of the event- Parameters:
endTime
- Time embedded in theDate
object
-
getIndex
public int getIndex()
Get the (server side) index of the event- Returns:
-
getSlotIndex
public int getSlotIndex()
Get the index of the slot where the event in rendered- Returns:
-
setSlotIndex
public void setSlotIndex(int index)
Set the index of the slot where the event in rendered- Parameters:
index
- The index of the slot
-
setIndex
public void setIndex(int index)
Set the (server side) index of the event- Parameters:
index
- The index
-
getCaption
public String getCaption()
Get the caption of the event. The caption is the text displayed in the calendar on the event.- Returns:
-
setCaption
public void setCaption(String caption)
Set the caption of the event. The caption is the text displayed in the calendar on the event.- Parameters:
caption
- The visible caption of the event
-
getDescription
public String getDescription()
Get the description of the event. The description is the text displayed when hoovering over the event with the mouse- Returns:
-
setDescription
public void setDescription(String description)
Set the description of the event. The description is the text displayed when hoovering over the event with the mouse- Parameters:
description
-
-
setFormat24h
public void setFormat24h(boolean format24h)
Does the event use the 24h time format- Parameters:
format24h
- True if it uses the 24h format, false if it uses the 12h time format
-
setAllDay
public void setAllDay(boolean allDay)
Is the event an all day event.- Parameters:
allDay
- True if the event should be rendered all day
-
isAllDay
public boolean isAllDay()
Is the event an all day event.- Returns:
-
getTimeAsText
public String getTimeAsText()
Get the time as a formatted string- Returns:
-
getRangeInMilliseconds
public long getRangeInMilliseconds()
Get the amount of milliseconds between the start and end of the event- Returns:
-
getRangeInMinutes
public long getRangeInMinutes()
Get the amount of minutes between the start and end of the event- Returns:
-
getRangeInMinutesForDay
public long getRangeInMinutesForDay(Date targetDay)
Get the amount of minutes for the event on a specific day. This is useful if the event spans several days.- Parameters:
targetDay
- The date to check- Returns:
-
isTimeOnDifferentDays
public boolean isTimeOnDifferentDays()
Does the event span several days- Returns:
-
-