BrightSide Workbench Full Report + Source Code
org.turro.contacts.cal.ContactCalendar Class Reference
Inheritance diagram for org.turro.contacts.cal.ContactCalendar:
Collaboration diagram for org.turro.contacts.cal.ContactCalendar:

Public Member Functions

String getName ()
 
String getLabelName ()
 
String getHeaderColor ()
 
String getContentColor ()
 
List< ICalendarEventgetEvents ()
 
List< ICalendarEventgetEvents (Date from, Date to)
 
void setEvents (List< ICalendarEvent > events)
 
void setEvent (ICalendarEvent event)
 
ICalendarEvent newEvent ()
 
void setIContact (IContact contact)
 
- Public Member Functions inherited from org.turro.elephant.impl.abstracts.AbstractImplementation
 AbstractImplementation ()
 
void setElement (IElement element)
 
void setConstructor (IConstructor constructor)
 
void setConfiguration (Element configuration)
 
KeyValueMap getAttributes ()
 
Long getLongAttribute (String key)
 

Additional Inherited Members

- Protected Attributes inherited from org.turro.elephant.impl.abstracts.AbstractImplementation
IElement iel
 
IConstructor constructor
 
Element configuration
 
Map attributes
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 37 of file ContactCalendar.java.

Member Function Documentation

◆ getContentColor()

String org.turro.contacts.cal.ContactCalendar.getContentColor ( )

Implements org.turro.plugin.calendar.ICalendarModel.

Definition at line 59 of file ContactCalendar.java.

59  {
60  return "#668CD9";
61  }

◆ getEvents() [1/2]

List<ICalendarEvent> org.turro.contacts.cal.ContactCalendar.getEvents ( )

Implements org.turro.plugin.calendar.ICalendarModel.

Definition at line 64 of file ContactCalendar.java.

64  {
65  File root = new File(ElephantContext.getRealPath(PATH_CALENDAR));
66  if(!root.exists()) root.mkdir();
67  File cal = new File(root.getAbsolutePath() + "/" + contact.getId());
68  return (List<ICalendarEvent>) Serializer.deserialize(cal);
69  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getEvents() [2/2]

List<ICalendarEvent> org.turro.contacts.cal.ContactCalendar.getEvents ( Date  from,
Date  to 
)

Implements org.turro.plugin.calendar.ICalendarModel.

Definition at line 72 of file ContactCalendar.java.

72  {
73  // TODO clear out-of-date events
74  return getEvents();
75  }
Here is the call graph for this function:

◆ getHeaderColor()

String org.turro.contacts.cal.ContactCalendar.getHeaderColor ( )

Implements org.turro.plugin.calendar.ICalendarModel.

Definition at line 54 of file ContactCalendar.java.

54  {
55  return "#3467CE";
56  }

◆ getLabelName()

String org.turro.contacts.cal.ContactCalendar.getLabelName ( )

Implements org.turro.plugin.calendar.ICalendarModel.

Definition at line 49 of file ContactCalendar.java.

49  {
50  return I_.get(getName());
51  }
Here is the call graph for this function:

◆ getName()

String org.turro.contacts.cal.ContactCalendar.getName ( )

Implements org.turro.plugin.calendar.ICalendarModel.

Definition at line 44 of file ContactCalendar.java.

44  {
45  return "My calendar";
46  }
Here is the caller graph for this function:

◆ newEvent()

ICalendarEvent org.turro.contacts.cal.ContactCalendar.newEvent ( )

Implements org.turro.plugin.calendar.ICalendarModel.

Definition at line 94 of file ContactCalendar.java.

94  {
95  ICalendarEvent event = new ContactEvent();
96  event.setEventId(IdGenerator.generate());
97  return event;
98  }

◆ setEvent()

void org.turro.contacts.cal.ContactCalendar.setEvent ( ICalendarEvent  event)

Implements org.turro.plugin.calendar.ICalendarModel.

Definition at line 86 of file ContactCalendar.java.

86  {
87  if(Strings.isBlank(event.getEventId())) {
88  event.setEventId(IdGenerator.generate());
89  }
90  // save on setEvents
91  }
Here is the call graph for this function:

◆ setEvents()

void org.turro.contacts.cal.ContactCalendar.setEvents ( List< ICalendarEvent events)

Implements org.turro.plugin.calendar.ICalendarModel.

Definition at line 78 of file ContactCalendar.java.

78  {
79  File root = new File(ElephantContext.getRealPath(PATH_CALENDAR));
80  if(!root.exists()) root.mkdir();
81  File cal = new File(root.getAbsolutePath() + "/" + contact.getId());
82  Serializer.serialize(cal, events);
83  }
Here is the call graph for this function:

◆ setIContact()

void org.turro.contacts.cal.ContactCalendar.setIContact ( IContact  contact)

Implements org.turro.plugin.calendar.ICalendarModel.

Definition at line 101 of file ContactCalendar.java.

101  {
102  this.contact = contact;
103  }

The documentation for this class was generated from the following file: