19 package org.turro.mail.zul;
21 import java.util.Collection;
22 import java.util.TreeSet;
23 import org.turro.assistant.Assistant;
24 import org.turro.assistant.AssistantConstants;
25 import org.turro.assistant.AssistantSet;
26 import org.turro.assistant.Assistants;
27 import org.turro.elephant.util.Messages;
28 import org.turro.entities.Entities;
29 import org.turro.i18n.I_;
30 import org.turro.plugin.contacts.IContact;
31 import org.turro.zkoss.grid.DefaultRowRenderer;
32 import org.turro.zkoss.grid.PagingGrid;
33 import org.zkoss.zk.ui.Component;
34 import org.zkoss.zk.ui.event.Event;
35 import org.zkoss.zk.ui.event.EventListener;
36 import org.zkoss.zk.ui.event.Events;
37 import org.zkoss.zul.Column;
38 import org.zkoss.zul.Columns;
39 import org.zkoss.zul.Group;
40 import org.zkoss.zul.ListModelList;
41 import org.zkoss.zul.Row;
42 import org.zkoss.zul.Toolbarbutton;
60 Events.postEvent(
new Event(Events.ON_CHANGE));
67 Events.postEvent(
new Event(Events.ON_CHANGE));
86 private void addRows() {
87 getRows(
true).getChildren().clear();
89 if(as.isEmpty())
return;
93 protected void renderRow(
final Row row,
final Assistant value) {
96 Toolbarbutton delAttendee =
new Toolbarbutton();
97 delAttendee.setImage(
"/_zul/images/edit-delete.png");
98 delAttendee.addEventListener(Events.ON_CLICK,
new EventListener() {
100 public void onEvent(Event event)
throws Exception {
103 Events.postEvent(
new Event(Events.ON_CHANGE));
106 row.appendChild(delAttendee);
110 protected void renderGroup(Group group, Assistant value) {
114 Collection list = getSortedAttendees();
116 setModel(
new ListModelList(list));
121 private void addColumns() {
123 cols.getChildren().clear();
125 cols.appendChild(
new Column(I_.get(
"Contact")));
126 cols.appendChild(
new Column(
null,
null,
"40px"));
129 private Collection getSortedAttendees() {
130 TreeSet<Assistant>
set =
new TreeSet(
new RecipientComparator());
void addContact(IContact contact, Object relationEntity)
static void addAssistants(String role, AssistantSet list, Object data)
static Messages confirmDeletion()
static IElephantEntity getController(String path)
void addAssistantsByEntity(String entityPath, boolean deep)
void addContact(IContact contact)
AssistantSet getAssistants()
Columns getColumns(boolean create)
Rows getRows(boolean create)
void setRowCount(int rows)