19 package org.turro.sendable;
21 import java.util.Collection;
22 import java.util.TreeSet;
23 import org.turro.elephant.db.ElephantPU;
24 import org.turro.elephant.entities.db.Sendable;
25 import org.turro.elephant.entities.db.SendableAssistant;
26 import org.turro.elephant.util.Messages;
27 import org.turro.entities.Entities;
28 import org.turro.i18n.I_;
29 import org.turro.plugin.contacts.IContact;
30 import org.turro.zkoss.grid.DefaultRowRenderer;
31 import org.turro.zkoss.grid.PagingGrid;
32 import org.zkoss.zk.ui.Component;
33 import org.zkoss.zk.ui.event.Event;
34 import org.zkoss.zk.ui.event.EventListener;
35 import org.zkoss.zk.ui.event.Events;
36 import org.zkoss.zul.Column;
37 import org.zkoss.zul.Columns;
38 import org.zkoss.zul.Group;
39 import org.zkoss.zul.Image;
40 import org.zkoss.zul.ListModelList;
41 import org.zkoss.zul.Row;
42 import org.zkoss.zul.Space;
43 import org.zkoss.zul.Toolbarbutton;
54 this.sendable = sendable;
62 Events.postEvent(
new Event(Events.ON_CHANGE));
69 Events.postEvent(
new Event(Events.ON_CHANGE));
84 private void addRows() {
85 getRows(
true).getChildren().clear();
87 if(sendable ==
null)
return;
95 new Image(
"/_zul/images/mail_queue.png") :
98 Toolbarbutton delAttendee =
new Toolbarbutton();
99 delAttendee.setImage(
"/_zul/images/edit-delete.png");
100 delAttendee.addEventListener(Events.ON_CLICK,
new EventListener() {
102 public void onEvent(Event event)
throws Exception {
105 Events.postEvent(
new Event(Events.ON_CHANGE));
108 row.appendChild(delAttendee);
112 protected void renderGroup(Group group, SendableAssistant value) {
116 Collection list = getSortedAttendees();
118 setModel(
new ListModelList(list));
123 private void addColumns() {
125 cols.getChildren().clear();
127 cols.appendChild(
new Column(I_.get(
"Contact")));
128 cols.appendChild(
new Column(
null,
null,
"40px"));
129 cols.appendChild(
new Column(
null,
null,
"40px"));
132 private Collection getSortedAttendees() {
133 TreeSet<SendableAssistant>
set =
new TreeSet(
new AssistantComparator());
void addAssistantsByEntity(String entityPath, boolean deep)
void addContact(IContact contact)
Collection< SendableAssistant > getAssistants(boolean all)
static Messages confirmDeletion()
static IElephantEntity getController(String path)
void deleteObject(Object obj)
void addContact(IContact contact)
void setSendable(Sendable sendable)
void addAssistantsByEntity(String entityPath, boolean deep)
Columns getColumns(boolean create)
Rows getRows(boolean create)
void setRowCount(int rows)