public class BasicEvent extends Object implements EditableCalendarEvent, CalendarEvent.EventChangeNotifier
CalendarEvent. Has
setters for all required fields and fires events when this event is changed.CalendarEvent.EventChangeEvent, CalendarEvent.EventChangeListener, CalendarEvent.EventChangeNotifier| Constructor and Description |
|---|
BasicEvent()
Default constructor
|
BasicEvent(String caption,
String description,
Date date)
Constructor for creating an event with the same start and end date
|
BasicEvent(String caption,
String description,
Date startDate,
Date endDate)
Constructor for creating an event with a start date and an end date.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addEventChangeListener(CalendarEvent.EventChangeListener listener)
Add a listener to listen for EventChangeEvents.
|
protected void |
fireEventChange()
Fires an event change event to the listeners.
|
String |
getCaption()
Gets caption of event.
|
String |
getDescription()
Gets description of event.
|
Date |
getEnd()
Get end date of event.
|
Date |
getStart()
Gets start date of event.
|
String |
getStyleName()
Gets style name of event.
|
boolean |
isAllDay()
An all-day event typically does not occur at a specific time but targets
a whole day or days.
|
void |
removeEventChangeListener(CalendarEvent.EventChangeListener listener)
Remove a listener from the event provider.
|
void |
setAllDay(boolean isAllDay)
Does the event span the whole day.
|
void |
setCaption(String caption)
Set the visible text in the calendar for the event.
|
void |
setDescription(String description)
Set the description of the event.
|
void |
setEnd(Date end)
Set the end date of the event.
|
void |
setStart(Date start)
Set the start date for the event.
|
void |
setStyleName(String styleName)
Set the style name for the event used for styling the event cells
|
public BasicEvent()
public BasicEvent(String caption, String description, Date date)
caption - The caption for the eventdescription - The description for the eventdate - The date the event occurredpublic BasicEvent(String caption, String description, Date startDate, Date endDate)
caption - The caption for the eventdescription - The description for the eventstartDate - The start date of the eventendDate - The end date of the eventpublic String getCaption()
CalendarEventgetCaption in interface CalendarEventpublic String getDescription()
CalendarEventgetDescription in interface CalendarEventpublic Date getEnd()
CalendarEventgetEnd in interface CalendarEventpublic Date getStart()
CalendarEventgetStart in interface CalendarEventpublic String getStyleName()
CalendarEventGets style name of event. In the client, style name will be set to the event's element class name and can be styled by CSS
Styling example:Java code:
event.setStyleName("color1");
CSS:
.v-calendar-event-color1 {
background-color: #9effae;}getStyleName in interface CalendarEventpublic boolean isAllDay()
CalendarEventisAllDay in interface CalendarEventpublic void setCaption(String caption)
EditableCalendarEventsetCaption in interface EditableCalendarEventcaption - The text to show in the calendarpublic void setDescription(String description)
EditableCalendarEventsetDescription in interface EditableCalendarEventdescription - The text which describes the eventpublic void setEnd(Date end)
EditableCalendarEventsetEnd in interface EditableCalendarEventend - The end date to setpublic void setStart(Date start)
EditableCalendarEventsetStart in interface EditableCalendarEventstart - The start date of the eventpublic void setStyleName(String styleName)
EditableCalendarEventsetStyleName in interface EditableCalendarEventstyleName - The stylename to usepublic void setAllDay(boolean isAllDay)
EditableCalendarEventsetAllDay in interface EditableCalendarEventisAllDay - True if the event spans the whole day. In this case the start
and end times are ignored.public void addEventChangeListener(CalendarEvent.EventChangeListener listener)
CalendarEvent.EventChangeNotifieraddEventChangeListener in interface CalendarEvent.EventChangeNotifierlistener - The listener to addpublic void removeEventChangeListener(CalendarEvent.EventChangeListener listener)
CalendarEvent.EventChangeNotifierremoveEventChangeListener in interface CalendarEvent.EventChangeNotifierlistener - The listener to removeprotected void fireEventChange()
Copyright © 2016 Vaadin Ltd. All rights reserved.