19 package org.turro.zul.groupit;
21 import org.turro.command.Command;
22 import org.turro.command.Context;
23 import org.turro.contacts.FieldIt;
24 import org.turro.contacts.GroupIt;
25 import org.turro.contacts.db.ContactsPU;
26 import org.turro.elephant.util.Messages;
27 import org.turro.jpa.Dao;
28 import org.turro.zul.fieldit.FieldItGrid;
29 import org.zkoss.lang.Strings;
30 import org.zkoss.zk.ui.Component;
31 import org.zkoss.zk.ui.select.SelectorComposer;
32 import org.zkoss.zk.ui.select.annotation.Listen;
33 import org.zkoss.zk.ui.select.annotation.Wire;
34 import org.zkoss.zul.Checkbox;
35 import org.zkoss.zul.Toolbarbutton;
47 private Toolbarbutton createGroup;
50 private Toolbarbutton editGroup;
53 private Toolbarbutton deleteGroup;
62 private Checkbox exact;
68 private Toolbarbutton saveFields;
70 @Listen(
"onChange = #categoryBox")
73 createGroup.setDisabled(Strings.isBlank(groupTree.
getCategory()));
74 editGroup.setDisabled(
true);
75 deleteGroup.setDisabled(editGroup.isDisabled());
79 entities.
setExact(exact.isChecked());
83 @Listen(
"onSelect = #groupTree; onCheck = #exact")
86 deleteGroup.setDisabled(editGroup.isDisabled());
87 saveFields.setDisabled(
true);
91 entities.
setExact(exact.isChecked());
95 @Listen(
"onClick = #createGroup")
99 public Object execute(Context context) {
108 editGroup.setDisabled(
true);
109 deleteGroup.setDisabled(editGroup.isDisabled());
110 saveFields.setDisabled(
true);
117 @Listen(
"onClick = #editGroup")
121 public Object execute(Context context) {
131 @Listen(
"onClick = #deleteGroup")
135 groupTree.getSelectedItem().detach();
140 @Listen(
"onChange = #fields")
142 saveFields.setDisabled(
false);
145 @Listen(
"onClick = #saveFields")
157 createGroup.setDisabled(
true);
158 editGroup.setDisabled(
true);
159 deleteGroup.setDisabled(editGroup.isDisabled());
160 saveFields.setDisabled(
true);
161 saveFields.setAutodisable(
"+self");
static Messages confirmDeletion()
Messages add(String word)
void setEntityPath(String entityPath)
void setExact(boolean exact)
void setGroupIt(GroupIt groupIt)
void setCategory(String category)
void setCategory(String category)
GroupIt getSelectedGroup()
void changeSelectedGroup(GroupIt group)