19 package org.turro.contacts.util;
21 import java.util.ArrayList;
22 import java.util.Collection;
23 import org.turro.action.Contacts;
24 import org.turro.command.Command;
25 import org.turro.elephant.security.IUser;
26 import org.turro.elephant.util.Images;
27 import org.turro.i18n.I_;
28 import org.turro.plugin.contacts.IContact;
29 import org.turro.zkoss.dialog.SelectionDialog;
30 import org.turro.zkoss.layout.GridLayout;
31 import org.turro.zul.frame.Framework;
32 import org.zkoss.zk.ui.event.Event;
33 import org.zkoss.zk.ui.event.EventListener;
34 import org.zkoss.zk.ui.event.Events;
35 import org.zkoss.zul.A;
36 import org.zkoss.zul.Row;
44 private Collection<IContact> recipients =
new ArrayList<>();
48 this.recipients.addAll(recipients);
53 public static void selectRecipients(Collection<IContact> recipients, Command command) {
55 mr.setStyle(
"overflow:auto;");
59 mr,
"425px",
"350px", command);
62 private void addRecipients() {
70 final ContactCombobox cc =
new ContactCombobox();
72 cc.addEventListener(Events.ON_OK,
new EventListener<Event>() {
74 public void onEvent(Event event) throws Exception {
75 event.stopPropagation();
76 IContact c = cc.getIContact();
77 if(c.isWebUser() && Contacts.hasValidEmail(c)) {
78 insertBeforeRow(editRow);
87 private void addRecipient(
final IContact c) {
88 final Row row = getCurrentRow();
90 addCaption(c.getName() +
" : " + c.getConnector(IUser.CONNECTOR_EMAIL));
91 A del =
new A(
null, Images.getImage(
"edit-delete"));
92 del.addEventListener(Events.ON_CLICK,
new EventListener<Event>() {
94 public void onEvent(Event event) throws Exception {
102 recipients =
new ArrayList<>();
103 for(Object o : getRows().getChildren()) {
104 if(o instanceof Row) {
105 if(((Row) o).getValue() instanceof
IContact) {
106 recipients.add((
IContact) ((Row) o).getValue());
static String get(String msg)
void setColumns(int columns)
GridLayout addSpannedComponent(HtmlBasedComponent comp, int cols)
static Framework getCurrent()