18 package org.turro.contacts.zul.contact;
20 import org.turro.auth.Authentication;
21 import org.turro.contacts.Comment;
22 import org.turro.contacts.Contact;
23 import org.turro.elephant.context.Application;
24 import org.turro.elephant.util.Messages;
25 import org.turro.i18n.I_;
26 import org.zkoss.zk.ui.event.Event;
27 import org.zkoss.zk.ui.event.EventListener;
28 import org.zkoss.zk.ui.event.Events;
29 import org.zkoss.zul.Grid;
30 import org.zkoss.zul.Hbox;
31 import org.zkoss.zul.Image;
32 import org.zkoss.zul.Row;
33 import org.zkoss.zul.Rows;
34 import org.zkoss.zul.Separator;
35 import org.zkoss.zul.Textbox;
36 import org.zkoss.zul.Toolbar;
37 import org.zkoss.zul.Toolbarbutton;
47 private Toolbar toolbar;
48 private Toolbarbutton addButton;
56 this.contact = contact;
57 rows.getChildren().clear();
65 toolbar =
new Toolbar();
66 getParent().appendChild(toolbar);
73 final Row row =
new Row();
75 rows.appendChild(row);
77 Hbox hbox =
new Hbox();
78 row.appendChild(hbox);
80 final Textbox comment =
new Textbox();
83 comment.setText(c.getComment());
84 comment.addEventListener(Events.ON_CHANGE,
new EventListener() {
86 public void onEvent(Event event)
throws Exception {
90 c.setComment(comment.getText());
93 hbox.appendChild(comment);
96 hbox.appendChild(
new Separator(
"vertical"));
97 Image img =
new Image(
"/_zul/images/edit-delete.png");
98 img.setStyle(
"cursor:pointer");
99 img.addEventListener(Events.ON_CLICK,
new EventListener() {
101 public void onEvent(Event event)
throws Exception {
109 hbox.appendChild(img);
115 private void addToolbarButtons() {
116 addButton =
new Toolbarbutton(
118 "/_zul/images/new.png"
120 addButton.addEventListener(Events.ON_CLICK,
new EventListener() {
123 public void onEvent(Event event)
throws Exception {
131 toolbar.appendChild(addButton);
static IContact getIContact()
boolean isInRole(String role)
static Application getApplication()
static Messages confirmDeletion()
static String get(String msg)