19 package org.turro.dossier.zul.relation;
21 import org.turro.dossier.entity.Issue;
22 import org.turro.registry.Changes;
23 import org.zkoss.zk.ui.Executions;
24 import org.zkoss.zk.ui.IdSpace;
25 import org.zkoss.zk.ui.ext.AfterCompose;
26 import org.zkoss.zk.ui.select.Selectors;
27 import org.zkoss.zk.ui.select.annotation.Listen;
28 import org.zkoss.zk.ui.select.annotation.Wire;
29 import org.zkoss.zul.Checkbox;
30 import org.zkoss.zul.Panel;
31 import org.zkoss.zul.Toolbarbutton;
39 private boolean readOnly, treeCollapsed;
41 private Changes changes;
44 private Toolbarbutton addRelation;
46 @Wire(
"#editRelation")
47 private Toolbarbutton editRelation;
49 @Wire(
"#deleteRelation")
50 private Toolbarbutton deleteRelation;
53 private Checkbox mode;
55 @Wire(
"#relationTree")
58 @Listen(
"onSelect = #relationTree")
63 @Listen(
"onCheck = #mode")
64 public
void onMode() throws Exception {
65 relationTree.
setMode(mode.isChecked() ? 1 : 0);
69 @Listen(
"onClick = #addRelation")
75 @Listen(
"onClick = #editRelation")
81 @Listen(
"onClick = #deleteRelation")
88 Executions.createComponents(
"/WEB-INF/_zul/bs/comps/issue/relationControl.zul",
this,
null);
89 Selectors.wireComponents(
this,
this,
false);
90 Selectors.wireEventListeners(
this,
this);
114 this.readOnly = readOnly;
118 return treeCollapsed;
122 this.treeCollapsed = treeCollapsed;
130 this.changes = changes;
138 private void initComponents() {
143 private void updateButtons(IssueRelation current) {
144 if(!readOnly && current !=
null) {
145 addRelation.setDisabled(
false);
146 editRelation.setDisabled(!current.canEdit());
147 deleteRelation.setDisabled(!current.canDelete());
149 addRelation.setDisabled(
true);
150 editRelation.setDisabled(
true);
151 deleteRelation.setDisabled(
true);
void setTreeCollapsed(boolean treeCollapsed)
void setMode(Checkbox mode)
void setReadOnly(boolean readOnly)
void setIssue(Issue issue)
boolean isTreeCollapsed()
void setChanges(Changes changes)
IssueRelation getSelectedRelation()
void setIssue(Issue issue)