本文整理匯總了Java中org.primefaces.extensions.model.timeline.TimelineEvent類的典型用法代碼示例。如果您正苦於以下問題:Java TimelineEvent類的具體用法?Java TimelineEvent怎麽用?Java TimelineEvent使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
TimelineEvent類屬於org.primefaces.extensions.model.timeline包,在下文中一共展示了TimelineEvent類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getTimeLineEventsModel
import org.primefaces.extensions.model.timeline.TimelineEvent; //導入依賴的package包/類
public TimelineModel getTimeLineEventsModel() {
TimelineModel model = new TimelineModel();
if (this.selectedEntity != null && this.selectedEntity.getTimeLineEvents() != null) {
for (TimeLineEvent tle : this.selectedEntity.getTimeLineEvents()) {
model.add(
new TimelineEvent(
tle,
tle.getStartDate(),
tle.getEndDate()
)
);
}
}
return model;
}
示例2: createSecondTimeline
import org.primefaces.extensions.model.timeline.TimelineEvent; //導入依賴的package包/類
private void createSecondTimeline() {
modelSecond = new TimelineModel();
Calendar cal = Calendar.getInstance();
cal.set(2012, Calendar.AUGUST, 23, 0, 0, 0);
Date startProject = cal.getTime();
cal.set(2012, Calendar.AUGUST, 30, 0, 0, 0);
Date endProject = cal.getTime();
modelSecond.add(new TimelineEvent("Project A", startProject, endProject));
cal.set(2012, Calendar.AUGUST, 27, 0, 0, 0);
startProject = cal.getTime();
cal.set(2012, Calendar.AUGUST, 31, 0, 0, 0);
endProject = cal.getTime();
modelSecond.add(new TimelineEvent("Project B", startProject, endProject));
}
示例3: onChange
import org.primefaces.extensions.model.timeline.TimelineEvent; //導入依賴的package包/類
public void onChange(TimelineModificationEvent e) {
// get changed event and update the model
event = e.getTimelineEvent();
model.update(event);
// get overlapped events of the same group as for the changed event
TreeSet<TimelineEvent> overlappedEvents = model.getOverlappedEvents(event);
if (overlappedEvents == null) {
// nothing to merge
return;
}
// list of orders which can be merged in the dialog
overlappedOrders = new ArrayList<TimelineEvent>(overlappedEvents);
// no pre-selection
ordersToMerge = null;
// update the dialog's content and show the dialog
RequestContext requestContext = RequestContext.getCurrentInstance();
requestContext.update("overlappedOrdersInner");
requestContext.execute("overlapEventsWdgt.show()");
}
示例4: initialize
import org.primefaces.extensions.model.timeline.TimelineEvent; //導入依賴的package包/類
@PostConstruct
protected void initialize() {
model = new TimelineModel();
Calendar cal = Calendar.getInstance();
cal.set(2012, Calendar.MAY, 25, 0, 0, 0);
model.add(new TimelineEvent("First", cal.getTime()));
cal.set(2012, Calendar.MAY, 26, 0, 0, 0);
model.add(new TimelineEvent("Last", cal.getTime()));
// lower limit of visible range
cal.set(2012, Calendar.JANUARY, 1, 0, 0, 0);
min = cal.getTime();
// upper limit of visible range
cal.set(2012, Calendar.DECEMBER, 31, 0, 0, 0);
max = cal.getTime();
// one day in milliseconds for zoomMin
zoomMin = 1000L * 60 * 60 * 24;
// about three months in milliseconds for zoomMax
zoomMax = 1000L * 60 * 60 * 24 * 31 * 3;
}
示例5: onChange
import org.primefaces.extensions.model.timeline.TimelineEvent; //導入依賴的package包/類
public void onChange(TimelineModificationEvent e) {
// get changed event and update the model
event = e.getTimelineEvent();
model.update(event);
// get overlapped events of the same group as for the changed event
TreeSet<TimelineEvent> overlappedEvents = model.getOverlappedEvents(event);
if (overlappedEvents == null) {
// nothing to merge
return;
}
// list of orders which can be merged in the dialog
overlappedOrders = new ArrayList<TimelineEvent>(overlappedEvents);
// no pre-selection
ordersToMerge = null;
// update the dialog's content and show the dialog
RequestContext requestContext = RequestContext.getCurrentInstance();
requestContext.update("overlappedOrdersInner");
requestContext.execute("PF('overlapEventsWdgt').show()");
}
示例6: getAsObject
import org.primefaces.extensions.model.timeline.TimelineEvent; //導入依賴的package包/類
public Object getAsObject(FacesContext context, UIComponent component, String value) {
if (StringUtils.isBlank(value) || events == null || events.isEmpty()) {
return null;
}
for (TimelineEvent event : events) {
if (((Order) event.getData()).getNumber() == Integer.valueOf(value)) {
return event;
}
}
return null;
}
示例7: getAsString
import org.primefaces.extensions.model.timeline.TimelineEvent; //導入依賴的package包/類
public String getAsString(FacesContext context, UIComponent component, Object value) {
if (value == null) {
return null;
}
return String.valueOf(((Order) ((TimelineEvent) value).getData()).getNumber());
}
示例8: createFirstTimeline
import org.primefaces.extensions.model.timeline.TimelineEvent; //導入依賴的package包/類
private void createFirstTimeline() {
modelFirst = new TimelineModel();
Calendar cal = Calendar.getInstance();
cal.set(2012, Calendar.AUGUST, 22, 17, 30, 0);
modelFirst.add(new TimelineEvent(new Task("Mail from boss", "timeline/mail.png", false), cal.getTime()));
cal.set(2012, Calendar.AUGUST, 23, 23, 0, 0);
modelFirst.add(new TimelineEvent(new Task("Call back my boss", "timeline/callback.png", false), cal.getTime()));
cal.set(2012, Calendar.AUGUST, 24, 21, 45, 0);
modelFirst.add(new TimelineEvent(new Task("Travel to Spain", "timeline/location.png", false), cal.getTime()));
cal.set(2012, Calendar.AUGUST, 26, 0, 0, 0);
Date startWork = cal.getTime();
cal.set(2012, Calendar.SEPTEMBER, 2, 0, 0, 0);
Date endWork = cal.getTime();
modelFirst.add(new TimelineEvent(new Task("Do homework", "timeline/homework.png", true), startWork, endWork));
cal.set(2012, Calendar.AUGUST, 28, 0, 0, 0);
modelFirst.add(new TimelineEvent(new Task("Create memo", "timeline/memo.png", false), cal.getTime()));
cal.set(2012, Calendar.AUGUST, 31, 0, 0, 0);
Date startReport = cal.getTime();
cal.set(2012, Calendar.SEPTEMBER, 3, 0, 0, 0);
Date endReport = cal.getTime();
modelFirst.add(new TimelineEvent(new Task("Create report", "timeline/report.png", true), startReport, endReport));
}
示例9: updateData
import org.primefaces.extensions.model.timeline.TimelineEvent; //導入依賴的package包/類
public void updateData(List<TimelineEvent> events) {
// update model
model.setEvents(events);
FacesMessage msg =
new FacesMessage(FacesMessage.SEVERITY_INFO, "Timeline model has been updated",
events != null ? events.size() + " events available" : "0 events available");
FacesContext.getCurrentInstance().addMessage(null, msg);
}
示例10: onAdd
import org.primefaces.extensions.model.timeline.TimelineEvent; //導入依賴的package包/類
public void onAdd(TimelineAddEvent e) {
// get TimelineEvent to be added
event = new TimelineEvent(new Booking(), e.getStartDate(), e.getEndDate(), true, e.getGroup());
// add the new event to the model in case if user will close or cancel the "Add dialog"
// without to update details of the new event. Note: the event is already added in UI.
model.add(event);
}
示例11: initialize
import org.primefaces.extensions.model.timeline.TimelineEvent; //導入依賴的package包/類
@PostConstruct
protected void initialize() {
model = new TimelineModel();
Calendar cal = Calendar.getInstance();
cal.set(2011, Calendar.MAY, 10, 0, 0, 0);
model.add(new TimelineEvent("Primefaces-Extensions 0.1", cal.getTime()));
cal.set(2012, Calendar.JANUARY, 23, 0, 0, 0);
model.add(new TimelineEvent("Primefaces-Extensions 0.2.0", cal.getTime()));
cal.set(2012, Calendar.APRIL, 2, 0, 0, 0);
model.add(new TimelineEvent("Primefaces-Extensions 0.3.0", cal.getTime()));
cal.set(2012, Calendar.APRIL, 16, 0, 0, 0);
model.add(new TimelineEvent("Primefaces-Extensions 0.4.0", cal.getTime()));
cal.set(2012, Calendar.JUNE, 10, 0, 0, 0);
model.add(new TimelineEvent("Primefaces-Extensions 0.5.0", cal.getTime()));
cal.set(2012, Calendar.JUNE, 19, 0, 0, 0);
model.add(new TimelineEvent("Primefaces-Extensions 0.5.1", cal.getTime()));
cal.set(2012, Calendar.SEPTEMBER, 26, 0, 0, 0);
model.add(new TimelineEvent("Primefaces-Extensions 0.6.0", cal.getTime()));
cal.set(2012, Calendar.OCTOBER, 13, 0, 0, 0);
model.add(new TimelineEvent("Primefaces-Extensions 0.6.1", cal.getTime()));
cal.set(2012, Calendar.DECEMBER, 16, 0, 0, 0);
model.add(new TimelineEvent("Primefaces-Extensions 0.6.2", cal.getTime()));
cal.set(2013, Calendar.FEBRUARY, 3, 0, 0, 0);
model.add(new TimelineEvent("Primefaces-Extensions 0.6.3", cal.getTime()));
}
示例12: getAsObject
import org.primefaces.extensions.model.timeline.TimelineEvent; //導入依賴的package包/類
public Object getAsObject(FacesContext context, UIComponent component, String value) {
if (StringUtils.isBlank(value) || events == null || events.isEmpty()) {
return null;
}
for (TimelineEvent event : events) {
if (((Order) event.getData()).getNumber() == Integer.valueOf(value)) {
return event;
}
}
return null;
}
示例13: getAsString
import org.primefaces.extensions.model.timeline.TimelineEvent; //導入依賴的package包/類
public String getAsString(FacesContext context, UIComponent component, Object value) {
if (value == null) {
return null;
}
return String.valueOf(((Order) ((TimelineEvent) value).getData()).getNumber());
}
示例14: getEvents
import org.primefaces.extensions.model.timeline.TimelineEvent; //導入依賴的package包/類
public List<TimelineEvent> getEvents() {
return events;
}
示例15: setEvents
import org.primefaces.extensions.model.timeline.TimelineEvent; //導入依賴的package包/類
public void setEvents(List<TimelineEvent> events) {
this.events = events;
}