1 19 package org.lucane.applications.calendar.util; 20 21 import java.util.*; 22 import org.lucane.applications.calendar.*; 23 24 public class EventUtils 25 { 26 public static String getUserType(String userName, Event event) 27 { 28 if(event.getOrganizer().equals(userName)) 29 return "organizer"; 30 31 Attendee a = event.getAttendee(userName); 32 if(a == null) 33 return "external.viewer"; 34 35 return (a.isMandatory() ? "attendee.mandatory" : "attendee.optional"); 36 } 37 38 public static String getRecurrenceLabel(Event event) 39 { 40 return getRecurrenceLabel(event.getRecurrence()); 41 } 42 43 public static String getRecurrenceLabel(int recurrence) 44 { 45 String [] labels = { 46 "recur.none", 47 "recur.day", 48 "recur.week", 49 "recur.month", 50 "recur.year"}; 51 52 return labels[recurrence]; 53 } 54 } 55 56 | Popular Tags |