Class CalendarEvent
- java.lang.Object
-
- com.vaadin.v7.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 StringgetCaption()Get the caption of the event.StringgetDescription()Get the description of the event.DategetEnd()DategetEndTime()Get the end time of the event.intgetIndex()Get the (server side) index of the event.longgetRangeInMilliseconds()Get the amount of milliseconds between the start and end of the event.longgetRangeInMinutes()Get the amount of minutes between the start and end of the event.longgetRangeInMinutesForDay(Date targetDay)Get the amount of minutes for the event on a specific day.intgetSlotIndex()Get the index of the slot where the event in rendered.DategetStart()DategetStartTime()Returns the start time of the event.StringgetStyleName()StringgetTimeAsText()Get the time as a formatted string.booleanisAllDay()Is the event an all day event.booleanisTimeOnDifferentDays()Does the event span several days.voidsetAllDay(boolean allDay)Is the event an all day event.voidsetCaption(String caption)Set the caption of the event.voidsetDescription(String description)Set the description of the event.voidsetEnd(Date end)voidsetEndTime(Date endTime)Set the end time of the event.voidsetFormat24h(boolean format24h)Does the event use the 24h time format.voidsetIndex(int index)Set the (server side) index of the event.voidsetSlotIndex(int index)Set the index of the slot where the event in rendered.voidsetStart(Date start)voidsetStartTime(Date startTime)Set the start time of the event.voidsetStyleName(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
Dateobject
-
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 theDateobject
-
getEndTime
public Date getEndTime()
Get the end time of the event.- Returns:
- Time embedded in the
Dateobject
-
setEndTime
public void setEndTime(Date endTime)
Set the end time of the event.- Parameters:
endTime- Time embedded in theDateobject
-
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 hovering 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 hovering 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:
-
-