19 package org.turro.sendable;
21 import java.util.Collection;
22 import org.turro.action.Contacts;
23 import org.turro.command.Command;
24 import org.turro.elephant.security.IUser;
25 import org.turro.elephant.util.Images;
26 import org.turro.entities.EntityCombobox;
27 import org.turro.i18n.I_;
28 import org.turro.plugin.contacts.ContactList;
29 import org.turro.plugin.contacts.IContact;
30 import org.turro.zkoss.dialog.SelectionDialog;
31 import org.turro.zkoss.layout.GridLayout;
32 import org.turro.zul.frame.Framework;
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.A;
37 import org.zkoss.zul.Row;
45 private Collection<IContact> recipients =
new ContactList();
49 this.recipients.addAll(recipients);
54 public static void selectRecipients(Collection<IContact> recipients, Command command) {
56 mr.setStyle(
"overflow:auto;");
60 mr,
"425px",
"350px", command);
63 private void addRecipients() {
71 final EntityCombobox cc =
new EntityCombobox();
72 cc.setRoot(
"contact");
74 cc.addEventListener(Events.ON_OK,
new EventListener<Event>() {
76 public void onEvent(Event event) throws Exception {
77 event.stopPropagation();
78 IContact c = Contacts.getContact(cc.getEntity());
79 if(c.isWebUser() && Contacts.hasValidEmail(c)) {
80 insertBeforeRow(editRow);
89 private void addRecipient(
final IContact c) {
90 final Row row = getCurrentRow();
92 addCaption(c.getName() +
" : " + c.getConnector(IUser.CONNECTOR_EMAIL));
93 A del =
new A(
null, Images.getImage(
"edit-delete"));
94 del.addEventListener(Events.ON_CLICK,
new EventListener<Event>() {
96 public void onEvent(Event event) throws Exception {
105 for(Object o : getRows().getChildren()) {
106 if(o instanceof Row) {
107 if(((Row) o).getValue() instanceof
IContact) {
108 recipients.add((
IContact) ((Row) o).getValue());
static String get(String msg)
static void selectRecipients(Collection< IContact > recipients, Command command)
MailRecipients(Collection< IContact > recipients)
Collection< IContact > getRecipients()
void setColumns(int columns)
GridLayout addSpannedComponent(HtmlBasedComponent comp, int cols)
static Framework getCurrent()