本文整理汇总了Java中net.fortuna.ical4j.model.TimeZoneRegistry.getTimeZone方法的典型用法代码示例。如果您正苦于以下问题:Java TimeZoneRegistry.getTimeZone方法的具体用法?Java TimeZoneRegistry.getTimeZone怎么用?Java TimeZoneRegistry.getTimeZone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.fortuna.ical4j.model.TimeZoneRegistry
的用法示例。
在下文中一共展示了TimeZoneRegistry.getTimeZone方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createCalendar
import net.fortuna.ical4j.model.TimeZoneRegistry; //导入方法依赖的package包/类
public static Calendar createCalendar(CalDavEvent calDavEvent, DateTimeZone timeZone) {
TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();
TimeZone timezone = registry.getTimeZone(timeZone.getID());
Calendar calendar = new Calendar();
calendar.getProperties().add(Version.VERSION_2_0);
calendar.getProperties().add(new ProdId("openHAB"));
VEvent vEvent = new VEvent();
vEvent.getProperties().add(new Summary(calDavEvent.getName()));
vEvent.getProperties().add(new Description(calDavEvent.getContent()));
final DtStart dtStart = new DtStart(new net.fortuna.ical4j.model.DateTime(calDavEvent.getStart().toDate()));
dtStart.setTimeZone(timezone);
vEvent.getProperties().add(dtStart);
final DtEnd dtEnd = new DtEnd(new net.fortuna.ical4j.model.DateTime(calDavEvent.getEnd().toDate()));
dtEnd.setTimeZone(timezone);
vEvent.getProperties().add(dtEnd);
vEvent.getProperties().add(new Uid(calDavEvent.getId()));
vEvent.getProperties().add(Clazz.PUBLIC);
vEvent.getProperties()
.add(new LastModified(new net.fortuna.ical4j.model.DateTime(calDavEvent.getLastChanged().toDate())));
calendar.getComponents().add(vEvent);
return calendar;
}
示例2: parseAppointmenttoCalendar
import net.fortuna.ical4j.model.TimeZoneRegistry; //导入方法依赖的package包/类
/**
* Methods to parse Appointment to iCalendar according RFC 2445
*
* @param appointment to be converted to iCalendar
* @return iCalendar representation of the Appointment
*/
public Calendar parseAppointmenttoCalendar(Appointment appointment) {
String tzid = parseTimeZone(null, appointment.getOwner()).getID();
TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();
net.fortuna.ical4j.model.TimeZone timeZone = registry.getTimeZone(tzid);
if (timeZone == null) {
throw new NoSuchElementException("Unable to get time zone by id provided: " + tzid);
}
Calendar icsCalendar = new Calendar();
icsCalendar.getProperties().add(new ProdId("-//Events Calendar//Apache Openmeetings//EN"));
icsCalendar.getProperties().add(Version.VERSION_2_0);
icsCalendar.getProperties().add(CalScale.GREGORIAN);
icsCalendar.getComponents().add(timeZone.getVTimeZone());
DateTime start = new DateTime(appointment.getStart()), end = new DateTime(appointment.getEnd());
VEvent meeting = new VEvent(start, end, appointment.getTitle());
meeting = addVEventpropsfromAppointment(appointment, meeting);
icsCalendar.getComponents().add(meeting);
return icsCalendar;
}
示例3: parseAppointmentstoCalendar
import net.fortuna.ical4j.model.TimeZoneRegistry; //导入方法依赖的package包/类
/**
* Parses a List of Appointments into a VCALENDAR component.
*
* @param appointments List of Appointments for the Calendar
* @param ownerId Owner of the Appointments
* @return VCALENDAR representation of the Appointments
*/
public Calendar parseAppointmentstoCalendar(List<Appointment> appointments, Long ownerId) {
String tzid = parseTimeZone(null, userDao.get(ownerId)).getID();
TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();
net.fortuna.ical4j.model.TimeZone timeZone = registry.getTimeZone(tzid);
if (timeZone == null) {
throw new NoSuchElementException("Unable to get time zone by id provided: " + tzid);
}
Calendar icsCalendar = new Calendar();
icsCalendar.getProperties().add(new ProdId(PROD_ID));
icsCalendar.getProperties().add(Version.VERSION_2_0);
icsCalendar.getProperties().add(CalScale.GREGORIAN);
icsCalendar.getComponents().add(timeZone.getVTimeZone());
for (Appointment appointment : appointments) {
DateTime start = new DateTime(appointment.getStart()), end = new DateTime(appointment.getEnd());
VEvent meeting = new VEvent(start, end, appointment.getTitle());
meeting = addVEventpropsfromAppointment(appointment, meeting);
icsCalendar.getComponents().add(meeting);
}
return icsCalendar;
}
示例4: getTimeZone
import net.fortuna.ical4j.model.TimeZoneRegistry; //导入方法依赖的package包/类
public VTimeZone getTimeZone(boolean timeIsLocal) {
//timezone. All dates are in GMT so we need to explicitly set that
TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();
//To prevent NPE on timezone
TimeZone timezone = null;
if (timeIsLocal == true) {
timezone = registry.getTimeZone(timeService.getLocalTimeZone().getID());
}
if (timezone == null) {
//This is guaranteed to return timezone if timeIsLocal == false or it fails and returns null
timezone = registry.getTimeZone("GMT");
}
return timezone.getVTimeZone();
}
示例5: makeCalendar
import net.fortuna.ical4j.model.TimeZoneRegistry; //导入方法依赖的package包/类
protected static Calendar makeCalendar(GenericValue workEffort, Map<String, Object> context) throws GenericEntityException {
String iCalData = null;
GenericValue iCalValue = workEffort.getRelatedOne("WorkEffortIcalData", false);
if (iCalValue != null) {
iCalData = iCalValue.getString("icalData");
}
boolean newCalendar = true;
Calendar calendar = null;
if (iCalData == null) {
Debug.logVerbose("iCalendar Data not found, creating new Calendar", module);
calendar = new Calendar();
} else {
Debug.logVerbose("iCalendar Data found, using saved Calendar", module);
StringReader reader = new StringReader(iCalData);
CalendarBuilder builder = new CalendarBuilder();
try {
calendar = builder.build(reader);
newCalendar = false;
} catch (Exception e) {
Debug.logError(e, "Error while parsing saved iCalendar, creating new iCalendar: ", module);
calendar = new Calendar();
}
}
PropertyList propList = calendar.getProperties();
replaceProperty(propList, prodId);
replaceProperty(propList, new XProperty(workEffortIdXPropName, workEffort.getString("workEffortId")));
if (newCalendar) {
propList.add(Version.VERSION_2_0);
propList.add(CalScale.GREGORIAN);
// TODO: Get time zone from publish properties value
java.util.TimeZone tz = java.util.TimeZone.getDefault();
TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();
net.fortuna.ical4j.model.TimeZone timezone = registry.getTimeZone(tz.getID());
calendar.getComponents().add(timezone.getVTimeZone());
}
return calendar;
}
示例6: getTimeZone
import net.fortuna.ical4j.model.TimeZoneRegistry; //导入方法依赖的package包/类
private TimeZone getTimeZone() {
VTimeZone vTimeZone = (VTimeZone) getCalendar().getComponent(Component.VTIMEZONE);
if (vTimeZone != null) {
return new TimeZone(vTimeZone);
}
// TODO workaround
TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();
java.util.TimeZone default_timeZone = java.util.TimeZone.getDefault();
TimeZone timezone = registry.getTimeZone(default_timeZone.getID());
return timezone;
}
示例7: createTestCalendar
import net.fortuna.ical4j.model.TimeZoneRegistry; //导入方法依赖的package包/类
/**
* Creates test calendar instance.
*
* @return ICal calendar object.
*/
protected Calendar createTestCalendar() throws ParseException {
// Create a TimeZone
TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();
TimeZone timezone = registry.getTimeZone("America/New_York");
VTimeZone tz = timezone.getVTimeZone();
// Start Date is on: April 1, 2013, 9:00 am
java.util.Calendar startDate = new GregorianCalendar();
startDate.setTimeZone(timezone);
startDate.set(java.util.Calendar.MONTH, java.util.Calendar.APRIL);
startDate.set(java.util.Calendar.DAY_OF_MONTH, 1);
startDate.set(java.util.Calendar.YEAR, 2013);
startDate.set(java.util.Calendar.HOUR_OF_DAY, 17);
startDate.set(java.util.Calendar.MINUTE, 0);
startDate.set(java.util.Calendar.SECOND, 0);
// End Date is on: April 1, 2013, 13:00
java.util.Calendar endDate = new GregorianCalendar();
endDate.setTimeZone(timezone);
endDate.set(java.util.Calendar.MONTH, java.util.Calendar.APRIL);
endDate.set(java.util.Calendar.DAY_OF_MONTH, 1);
endDate.set(java.util.Calendar.YEAR, 2013);
endDate.set(java.util.Calendar.HOUR_OF_DAY, 21);
endDate.set(java.util.Calendar.MINUTE, 0);
endDate.set(java.util.Calendar.SECOND, 0);
// Create the event
PropertyList propertyList = new PropertyList();
propertyList.add(new DtStamp("20130324T180000Z"));
propertyList.add(new DtStart(new DateTime(startDate.getTime())));
propertyList.add(new DtEnd(new DateTime(endDate.getTime())));
propertyList.add(new Summary("Progress Meeting"));
VEvent meeting = new VEvent(propertyList);
// add timezone info..
meeting.getProperties().add(tz.getTimeZoneId());
// generate unique identifier..
meeting.getProperties().add(new Uid("00000000"));
// add attendees..
Attendee dev1 = new Attendee(URI.create("mailto:[email protected]"));
dev1.getParameters().add(Role.REQ_PARTICIPANT);
dev1.getParameters().add(new Cn("Developer 1"));
meeting.getProperties().add(dev1);
Attendee dev2 = new Attendee(URI.create("mailto:[email protected]"));
dev2.getParameters().add(Role.OPT_PARTICIPANT);
dev2.getParameters().add(new Cn("Developer 2"));
meeting.getProperties().add(dev2);
// Create a calendar
net.fortuna.ical4j.model.Calendar icsCalendar = new net.fortuna.ical4j.model.Calendar();
icsCalendar.getProperties().add(Version.VERSION_2_0);
icsCalendar.getProperties().add(new ProdId("-//Events Calendar//iCal4j 1.0//EN"));
icsCalendar.getProperties().add(CalScale.GREGORIAN);
// Add the event and print
icsCalendar.getComponents().add(meeting);
return icsCalendar;
}
示例8: simpleInvitionIcalLink
import net.fortuna.ical4j.model.TimeZoneRegistry; //导入方法依赖的package包/类
public void simpleInvitionIcalLink() {
// Create a TimeZone
TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();
TimeZone timezone = registry.getTimeZone("America/Mexico_City");
VTimeZone tz = timezone.getVTimeZone();
// Start Date is on: April 1, 2008, 9:00 am
java.util.Calendar startDate = new GregorianCalendar();
startDate.setTimeZone(timezone);
startDate.set(java.util.Calendar.MONTH, java.util.Calendar.APRIL);
startDate.set(java.util.Calendar.DAY_OF_MONTH, 1);
startDate.set(java.util.Calendar.YEAR, 2008);
startDate.set(java.util.Calendar.HOUR_OF_DAY, 9);
startDate.set(java.util.Calendar.MINUTE, 0);
startDate.set(java.util.Calendar.SECOND, 0);
// End Date is on: April 1, 2008, 13:00
java.util.Calendar endDate = new GregorianCalendar();
endDate.setTimeZone(timezone);
endDate.set(java.util.Calendar.MONTH, java.util.Calendar.APRIL);
endDate.set(java.util.Calendar.DAY_OF_MONTH, 1);
endDate.set(java.util.Calendar.YEAR, 2008);
endDate.set(java.util.Calendar.HOUR_OF_DAY, 13);
endDate.set(java.util.Calendar.MINUTE, 0);
endDate.set(java.util.Calendar.SECOND, 0);
// Create the event
String eventName = "Progress Meeting";
DateTime start = new DateTime(startDate.getTime());
DateTime end = new DateTime(endDate.getTime());
VEvent meeting = new VEvent(start, end, eventName);
// add timezone info..
meeting.getProperties().add(tz.getTimeZoneId());
// generate unique identifier..
Uid uid = new Uid(UUID.randomUUID().toString());
meeting.getProperties().add(uid);
// add attendees..
Attendee dev1 = new Attendee(URI.create("mailto:[email protected]"));
dev1.getParameters().add(Role.REQ_PARTICIPANT);
dev1.getParameters().add(new Cn("Developer 1"));
meeting.getProperties().add(dev1);
Attendee dev2 = new Attendee(URI.create("mailto:[email protected]"));
dev2.getParameters().add(Role.OPT_PARTICIPANT);
dev2.getParameters().add(new Cn("Developer 2"));
meeting.getProperties().add(dev2);
// Create a calendar
net.fortuna.ical4j.model.Calendar icsCalendar = new net.fortuna.ical4j.model.Calendar();
icsCalendar.getProperties().add(
new ProdId("-//Events Calendar//iCal4j 1.0//EN"));
icsCalendar.getProperties().add(CalScale.GREGORIAN);
icsCalendar.getProperties().add(Version.VERSION_2_0);
// Add the event and print
icsCalendar.getComponents().add(meeting);
Organizer orger = new Organizer(URI.create("[email protected]"));
orger.getParameters().add(new Cn("Sebastian Wagner"));
meeting.getProperties().add(orger);
icsCalendar.getProperties().add(Method.REQUEST);
log.debug(icsCalendar.toString());
ByteArrayOutputStream bout = new ByteArrayOutputStream();
CalendarOutputter outputter = new CalendarOutputter();
try {
outputter.output(icsCalendar, bout);
iCalMimeBody = bout.toByteArray();
sendIcalMessage();
} catch (Exception e) {
log.error("Error", e);
}
}
示例9: addEventsFromWorkItemList
import net.fortuna.ical4j.model.TimeZoneRegistry; //导入方法依赖的package包/类
/**
* Put in the calendar an Event for each workitem
* @param workItemList
* @param calendar
*/
private void addEventsFromWorkItemList(List<TWorkItemBean> workItemList, Calendar calendar, Locale locale) throws IOException {
for (Iterator<TWorkItemBean> it = workItemList.iterator(); it.hasNext();) {
TWorkItemBean issue =it.next();
//If it hasn't got any date, do nothing
if (issue.getStartDate() != null || issue.getEndDate() != null ){
// Create a TimeZone
// TODO: It is needed to tests if it manages the daylight times
final java.util.TimeZone serverTimeZone = java.util.TimeZone.getDefault();
TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();
TimeZone timezone = registry.getTimeZone(serverTimeZone.getID());
VTimeZone tz = timezone.getVTimeZone();
//set the event depending if it has start date and/or end date
//always mark it as Full Day Task (it appears in the header of the day)
VEvent issueEvent;
java.util.Calendar startDate = new GregorianCalendar();
startDate.setTimeZone(timezone);
java.util.Calendar endDate = new GregorianCalendar();
endDate.setTimeZone(timezone);
if (issue.getStartDate() != null) {
startDate.setTime(issue.getStartDate());
if (issue.getEndDate() != null) { // startDate and endDate => use both
endDate.setTime(issue.getEndDate());
} else { // startDate and !endDate => use startDate
endDate.setTime(issue.getStartDate());
}
}else{ // !startDate and endDate => use endDate
startDate.setTime(issue.getEndDate());
endDate.setTime(issue.getEndDate());
}
Integer responsibleID = issue.getResponsibleID();
String description = issue.getDescription();
if (description!=null) {
try {
description = Html2Text.getNewInstance().convert(description);
} catch (Exception e) {
}
}
if (startDate.equals(endDate)) {
startDate.add(java.util.Calendar.DAY_OF_MONTH,1);
issueEvent = createEvent(new Date(startDate.getTime()), new Date(startDate.getTime()), issue.getSynopsis(), issue.getObjectID(), description, responsibleID, tz);
calendar.getComponents().add(issueEvent);
} else {
startDate.add(java.util.Calendar.DAY_OF_MONTH,1);
String title = LocalizeUtil.getParametrizedString("admin.myprefs.iCalendar.start", new Object[] {issue.getSynopsis()}, locale);
issueEvent = createEvent(new Date(startDate.getTime()), new Date(startDate.getTime()), title, issue.getObjectID(), description, responsibleID, tz);
calendar.getComponents().add(issueEvent);
endDate.add(java.util.Calendar.DAY_OF_MONTH,1);
title = LocalizeUtil.getParametrizedString("admin.myprefs.iCalendar.end", new Object[] {issue.getSynopsis()}, locale);
issueEvent = createEvent(new Date(endDate.getTime()), new Date(endDate.getTime()), title, issue.getObjectID(), description, responsibleID, tz);
calendar.getComponents().add(issueEvent);
}
// the period is [StartDate,EndDate)
}
}
}
示例10: wrap
import net.fortuna.ical4j.model.TimeZoneRegistry; //导入方法依赖的package包/类
public void wrap(ContentValues values, VEvent vevent) {
Property property = vevent.getProperty(keyVEvent);
if (property != null) {
try {
Log.d(LOG_ID, "VEvent: " + keyVEvent + " GoogleEvent: " + keyGoogleEvent
+ " Value: " + property.getValue());
long timeInMillis = 0;
Parameter parameter = property.getParameter("VALUE");
if (parameter != null && parameter.getValue().equals("DATE")) {
int year = Integer.parseInt(property.getValue().substring(0, 4));
int month = Integer.parseInt(property.getValue().substring(4, 6));
int day = Integer.parseInt(property.getValue().substring(6, 8));
java.util.Calendar cal = java.util.Calendar.getInstance();
cal.clear();
cal.set(year, month - 1, day, 0, 0, 0);
timeInMillis = cal.getTimeInMillis();
} else {
timeInMillis = dateToMillis(new DateTime(property.getValue()));
}
if (property.getParameter("TZID") != null) {
String tzone = property.getParameter("TZID").getValue();
if (tzone != null) {
TimeZoneRegistry registry = Controller.calendarBuilder.getRegistry();
TimeZone z = registry.getTimeZone(tzone);
if (z != null) {
Log.d(LOG_ID, "Adjusting timezone by " + z.getRawOffset());
int z1 = z.getRawOffset();
// Try to convert gmt GMT-05:00
int z2 = 0;
TimeZone currentZone = TimeZone.getDefault();
String dispName = currentZone.getDisplayName(true, TimeZone.SHORT);
if (dispName.startsWith("GMT")) {
int shift = 0;
if (dispName.matches("GMT[+].*")) {
shift++;
}
if (dispName.matches("GMT[+|-][0-9][0-9]:[0-9][0-9].*")) {
z2 = Integer.parseInt(dispName.substring(3 + shift, 6)) * 3600000;
z2 += ((z2 < 0) ? -1 : 1)
* (Integer.parseInt(dispName.substring(7, 9)) * 60000);
} else if (dispName.matches("GMT[+|-][0-9][0-9].*")) {
z2 = Integer.parseInt(dispName.substring(3 + shift, 6)) * 3600000;
} else if (dispName.matches("GMT[+|-][0-9].*")) {
z2 = Integer.parseInt(dispName.substring(3 + shift, 5)) * 3600000;
}
} else {
z2 = currentZone.getRawOffset();
}
timeInMillis -= z1 - z2;
} else {
Log.d(LOG_ID, "Could not find timezone: " + tzone);
}
}
values.put("eventTimezone", tzone);
}
values.put(keyGoogleEvent, timeInMillis);
} catch (ParseException e) {
e.printStackTrace();
}
}
}
示例11: createTestCalendar
import net.fortuna.ical4j.model.TimeZoneRegistry; //导入方法依赖的package包/类
private Calendar createTestCalendar() throws ParseException {
// Create a TimeZone
TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();
TimeZone timezone = registry.getTimeZone("America/New_York");
VTimeZone tz = timezone.getVTimeZone();
// Start Date is on: April 1, 2013, 9:00 am
java.util.Calendar startDate = new GregorianCalendar();
startDate.setTimeZone(timezone);
startDate.set(java.util.Calendar.MONTH, java.util.Calendar.APRIL);
startDate.set(java.util.Calendar.DAY_OF_MONTH, 1);
startDate.set(java.util.Calendar.YEAR, 2013);
startDate.set(java.util.Calendar.HOUR_OF_DAY, 17);
startDate.set(java.util.Calendar.MINUTE, 0);
startDate.set(java.util.Calendar.SECOND, 0);
// End Date is on: April 1, 2013, 13:00
java.util.Calendar endDate = new GregorianCalendar();
endDate.setTimeZone(timezone);
endDate.set(java.util.Calendar.MONTH, java.util.Calendar.APRIL);
endDate.set(java.util.Calendar.DAY_OF_MONTH, 1);
endDate.set(java.util.Calendar.YEAR, 2013);
endDate.set(java.util.Calendar.HOUR_OF_DAY, 21);
endDate.set(java.util.Calendar.MINUTE, 0);
endDate.set(java.util.Calendar.SECOND, 0);
// Create the event
PropertyList propertyList = new PropertyList();
propertyList.add(new DtStamp("20130324T180000Z"));
propertyList.add(new DtStart(new DateTime(startDate.getTime())));
propertyList.add(new DtEnd(new DateTime(endDate.getTime())));
propertyList.add(new Summary("Progress Meeting"));
VEvent meeting = new VEvent(propertyList);
// add timezone info..
meeting.getProperties().add(tz.getTimeZoneId());
// generate unique identifier..
meeting.getProperties().add(new Uid("00000000"));
// add attendees..
Attendee dev1 = new Attendee(URI.create("mailto:[email protected]"));
dev1.getParameters().add(Role.REQ_PARTICIPANT);
dev1.getParameters().add(new Cn("Developer 1"));
meeting.getProperties().add(dev1);
Attendee dev2 = new Attendee(URI.create("mailto:[email protected]"));
dev2.getParameters().add(Role.OPT_PARTICIPANT);
dev2.getParameters().add(new Cn("Developer 2"));
meeting.getProperties().add(dev2);
// Create a calendar
net.fortuna.ical4j.model.Calendar icsCalendar = new net.fortuna.ical4j.model.Calendar();
icsCalendar.getProperties().add(Version.VERSION_2_0);
icsCalendar.getProperties().add(new ProdId("-//Events Calendar//iCal4j 1.0//EN"));
icsCalendar.getProperties().add(CalScale.GREGORIAN);
// Add the event and print
icsCalendar.getComponents().add(meeting);
return icsCalendar;
}
示例12: okPressed
import net.fortuna.ical4j.model.TimeZoneRegistry; //导入方法依赖的package包/类
@Override
protected void okPressed(){
von.setTimeInMillis(dpVon.getDate().getTime());
bis.setTimeInMillis(dpBis.getDate().getTime());
Query<Termin> qbe = new Query<Termin>(Termin.class);
qbe.add(Termin.FLD_TAG, Query.GREATER_OR_EQUAL, von.toString(TimeTool.DATE_COMPACT));
qbe.add(Termin.FLD_TAG, Query.LESS_OR_EQUAL, bis.toString(TimeTool.DATE_COMPACT));
qbe.add(Termin.FLD_BEREICH, Query.EQUALS, m);
List<Termin> termine = qbe.execute();
String fname = lFile.getText();
if (fname.toLowerCase().endsWith(".csv")) { //$NON-NLS-1$
new CSVExporter().doExport(fname, termine);
} else {
TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();
TimeZone timezone = registry.getTimeZone("Europe/Zurich"); //$NON-NLS-1$
VTimeZone tz = timezone.getVTimeZone();
Calendar calendar = new Calendar();
calendar.getProperties().add(new ProdId("-//ch.elexis//Elexis v" + CoreHub.Version)); //$NON-NLS-1$
calendar.getProperties().add(Version.VERSION_2_0);
calendar.getProperties().add(CalScale.GREGORIAN);
for (Termin t : termine) {
if ((t.getStartMinute() == 0) && (t.getType().equals(Termin.typReserviert()))) {
continue;
}
if ((t.getStartMinute() + t.getDurationInMinutes() == (23 * 60) + 59)
&& (t.getType().equals(Termin.typReserviert()))) {
continue;
}
TimeTool tt = new TimeTool(t.getStartTime());
DateTime start = new DateTime(tt.getTime());
tt.addMinutes(t.getDurationInMinutes());
DateTime end = new DateTime(tt.getTime());
VEvent vTermin = new VEvent(start, end, t.getPersonalia());
vTermin.getProperties().add(tz.getTimeZoneId());
Uid uid = new Uid(t.getId());
vTermin.getProperties().add(uid);
Description desc = new Description(t.getGrund());
vTermin.getProperties().add(desc);
calendar.getComponents().add(vTermin);
}
try {
FileOutputStream fout = new FileOutputStream(lFile.getText());
CalendarOutputter outputter = new CalendarOutputter();
outputter.output(calendar, fout);
} catch (Exception ex) {
ExHandler.handle(ex);
SWTHelper.alert(
Messages.ICalTransfer_iOError,
MessageFormat.format(Messages.ICalTransfer_couldNotWriteFile,
lFile.getText()));
}
}
super.okPressed();
}