1 package org.columba.calendar.base; 19 20 import java.beans.PropertyVetoException ; 21 import java.util.Calendar ; 22 23 import org.columba.calendar.base.api.IActivity; 24 25 import com.miginfocom.util.PropertyKey; 26 27 public class Activity implements IActivity { 28 29 private com.miginfocom.calendar.activity.Activity wrapped; 30 31 public Activity(com.miginfocom.calendar.activity.Activity wrapped) { 32 super(); 33 34 this.wrapped = wrapped; 35 } 36 37 public String getId() { 38 return (String ) wrapped.getID(); 39 } 40 41 public String getProperty(String propertyKey) { 42 Object value = wrapped.getProperty(PropertyKey.getKey(propertyKey)); 43 44 return (String ) value; 45 } 46 47 public void setProperty(String propertyKey, String propertyValue) { 48 49 try { 50 wrapped.setProperty(PropertyKey.getKey(propertyKey), propertyValue, 52 Boolean.TRUE); 53 } catch (PropertyVetoException e) { 54 throw new IllegalArgumentException ("illegal argument", e); 55 } 56 } 57 58 public String getSummary() { 59 return wrapped.getSummary(); 60 } 61 62 public Calendar getDtStart() { 63 return wrapped.getDateRangeForReading().getStart(); 64 } 65 66 public Calendar getDtEnd() { 67 return wrapped.getDateRangeForReading().getEnd(true); 68 } 69 70 public String getCalendarId() { 71 Object [] categories = wrapped.getCategoryIDs(); 73 74 return (String ) categories[0]; 75 } 76 77 } 78 | Popular Tags |