}
private List<EventAction> getEventActionComponents(FacesContext context, EventActionBar actionBar) {
List<EventAction> result = new ArrayList<EventAction>();
List<UIComponent> children = actionBar.getChildren();
DeleteEventAction deleteEventAction = null;
for (UIComponent component : children) {
if (!(component instanceof EventAction))
continue;
if (component.isRendered())
result.add((EventAction) component);
if (component instanceof DeleteEventAction)
deleteEventAction = (DeleteEventAction) component;
}
TimetableView timeTable = (TimetableView) actionBar.getParent();
boolean tableEditable = timeTable.isEditable();
if (tableEditable) {
if (deleteEventAction == null) {
deleteEventAction = Components.createComponent(context,
DeleteEventAction.COMPONENT_TYPE, DeleteEventAction.class, actionBar, "deleteEventAction");
result.add(deleteEventAction);
actionBar.getChildren().add(deleteEventAction);
}
deleteEventAction.setOnclick("O$.Timetable._deleteCurrentTimetableEvent(event)");
Confirmation confirmation = timeTable.getDeletionConfirmation();
if (confirmation != null) {
if (deleteEventAction.isRendered() && deleteEventAction.getShowConfirmation()) {
confirmation.setRendered(true);
if (deleteEventAction.getId() == null)
deleteEventAction.setId(context.getViewRoot().createUniqueId());
confirmation.setFor(deleteEventAction.getId());
confirmation.setEvent("click");
} else
confirmation.setRendered(false);
}
}