本文整理汇总了Java中net.fortuna.ical4j.model.component.VEvent.getSummary方法的典型用法代码示例。如果您正苦于以下问题:Java VEvent.getSummary方法的具体用法?Java VEvent.getSummary怎么用?Java VEvent.getSummary使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.fortuna.ical4j.model.component.VEvent
的用法示例。
在下文中一共展示了VEvent.getSummary方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mergeCalendarProperties
import net.fortuna.ical4j.model.component.VEvent; //导入方法依赖的package包/类
/**
* Merges calendar properties.
* @param event The event.
* @param note The note item.
*/
private void mergeCalendarProperties(VEvent event, NoteItem note) {
//summary = displayName
//description = body
//uid = icalUid
//dtstamp = clientModifiedDate/modifiedDate
boolean isMod = note.getModifies()!=null;
if (isMod) {
ICalendarUtils.setUid(note.getModifies().getIcalUid(), event);
}
else {
ICalendarUtils.setUid(note.getIcalUid(), event);
}
// inherited displayName and body should always be serialized
if (event.getSummary() != null) {
ICalendarUtils.setSummary(event.getSummary().getValue(), event);
} else if (note.getDisplayName()==null && isMod) {
ICalendarUtils.setSummary(note.getModifies().getDisplayName(), event);
}
else {
ICalendarUtils.setSummary(note.getDisplayName(), event);
}
if (event.getDescription() != null) {
ICalendarUtils.setDescription(event.getDescription().getValue(), event);
} else if (note.getBody()==null && isMod) {
ICalendarUtils.setDescription(note.getModifies().getBody(), event);
} else {
ICalendarUtils.setDescription(note.getBody(), event);
}
if (note.getClientModifiedDate()!=null) {
ICalendarUtils.setDtStamp(note.getClientModifiedDate(), event);
}
else {
ICalendarUtils.setDtStamp(note.getModifiedDate(), event);
}
if (StampUtils.getTaskStamp(note) != null) {
ICalendarUtils.setXProperty(X_OSAF_STARRED, "TRUE", event);
}
else {
ICalendarUtils.setXProperty(X_OSAF_STARRED, null, event);
}
}
示例2: setCalendarAttributes
import net.fortuna.ical4j.model.component.VEvent; //导入方法依赖的package包/类
/**
* Sets calendar attributes.
* @param note The note item.
* @param event The event.
*/
private void setCalendarAttributes(NoteItem note, VEvent event) {
// UID (only set if master)
if(event.getUid()!=null && note.getModifies()==null) {
note.setIcalUid(event.getUid().getValue());
}
// for now displayName is limited to 1024 chars
if (event.getSummary() != null) {
note.setDisplayName(StringUtils.substring(event.getSummary()
.getValue(), 0, 1024));
}
if (event.getDescription() != null) {
note.setBody(event.getDescription().getValue());
}
// look for DTSTAMP
if(event.getDateStamp()!=null) {
note.setClientModifiedDate(event.getDateStamp().getDate());
}
// look for absolute VALARM
VAlarm va = ICalendarUtils.getDisplayAlarm(event);
if (va != null && va.getTrigger()!=null) {
Trigger trigger = va.getTrigger();
Date reminderTime = trigger.getDateTime();
if (reminderTime != null) {
note.setReminderTime(reminderTime);
}
}
// calculate triage status based on start date
java.util.Date now =java.util.Calendar.getInstance().getTime();
Date eventStartDate = event.getStartDate() != null && event.getStartDate().getDate() != null
? event.getStartDate().getDate()
:new Date();
boolean later = eventStartDate.after(now);
int code = later ? TriageStatus.CODE_LATER : TriageStatus.CODE_DONE;
TriageStatus triageStatus = note.getTriageStatus();
// initialize TriageStatus if not present
if (triageStatus == null) {
triageStatus = TriageStatusUtil.initialize(entityFactory
.createTriageStatus());
note.setTriageStatus(triageStatus);
}
triageStatus.setCode(code);
// check for X-OSAF-STARRED
if ("TRUE".equals(ICalendarUtils.getXProperty(X_OSAF_STARRED, event))) {
TaskStamp ts = StampUtils.getTaskStamp(note);
if (ts == null) {
note.addStamp(entityFactory.createTaskStamp());
}
}
}