/** * Remove a component from the list. * @param component the component to remove * @return true if the list contained the specified component * @see List#remove(java.lang.Object) */ public final boolean remove(final Component component) { return remove((Object) component); }
public void removeDisplayAlarm() { VEvent event = getEvent(); if(event==null) { return; } ComponentList<VAlarm> alarmsList = event.getAlarms(); for(VAlarm alarm: alarmsList) { if (alarm.getProperties().getProperty(Property.ACTION).equals( Action.DISPLAY)) { alarmsList.remove(alarm); } } }
public void removeDisplayAlarm() { VEvent event = getEvent(); if(event==null) { return; } ComponentList<VAlarm> alarmsList = event.getAlarms(); for(VAlarm alarm: alarmsList) { if (alarm.getProperties().getProperty(Property.ACTION).equals( Action.DISPLAY)) { alarmsList.remove(alarm); } } }
clist.remove(toBeRemoved);
masterCalendar.getComponents().remove(entry.getValue());
calendar.getComponents().remove(removeMe);
masterCalendar.getComponents().remove(entry.getValue());
/** * Updates the resource containing the VEvent with the same UID as the given * VEvent with the given VEvent * * @param httpClient the httpClient which will make the request * @param vevent the vevent to update * @param timezone The VTimeZone of the VEvent if it references one, * otherwise null * @throws CalDAV4JException on error */ // TODO: Deal with SEQUENCE public void updateMasterEvent(HttpClient httpClient, VEvent vevent, VTimeZone timezone) throws CalDAV4JException { String uid = ICalendarUtils.getUIDValue(vevent); CalDAVResource resource = getCalDAVResourceByUID(httpClient, Component.VEVENT, uid); Calendar calendar = resource.getCalendar(); //let's find the master event first! VEvent originalVEvent = ICalendarUtils.getMasterEvent(calendar, uid); calendar.getComponents().remove(originalVEvent); calendar.getComponents().add(vevent); if(timezone != null) { VTimeZone originalVTimeZone = ICalendarUtils.getTimezone(calendar); if (originalVTimeZone != null) calendar.getComponents().remove(originalVTimeZone); calendar.getComponents().add(timezone); } put(httpClient, calendar, UrlUtils.stripHost(resource.getResourceMetadata().getHref()), resource.getResourceMetadata().getETag()); }