BrightSide Workbench Full Report + Source Code
org.turro.dossier.zul.dossier.CategoryParticipantGrid2 Class Reference
Inheritance diagram for org.turro.dossier.zul.dossier.CategoryParticipantGrid2:
Collaboration diagram for org.turro.dossier.zul.dossier.CategoryParticipantGrid2:

Public Member Functions

 CategoryParticipantGrid2 ()
 
void setCategory (Category category)
 
void setAddToolbar (boolean addToolbar)
 
void addRows ()
 
void beforeSave ()
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 46 of file CategoryParticipantGrid2.java.

Constructor & Destructor Documentation

◆ CategoryParticipantGrid2()

org.turro.dossier.zul.dossier.CategoryParticipantGrid2.CategoryParticipantGrid2 ( )

Definition at line 53 of file CategoryParticipantGrid2.java.

53  {
54  addColumns();
55  rows = new Rows();
56  appendChild(rows);
57  }

Member Function Documentation

◆ addRows()

void org.turro.dossier.zul.dossier.CategoryParticipantGrid2.addRows ( )

Definition at line 88 of file CategoryParticipantGrid2.java.

88  {
89  for(final CategoryParticipant p : category.getParticipants()) {
90  Row row = new Row();
91  row.setValue(p);
92  rows.appendChild(row);
93 
94  Vbox vbox = new Vbox();
95  vbox.setWidth("100%");
96  row.appendChild(vbox);
97 
98  final ContactCombobox contact = new ContactCombobox();
99  contact.setRole("dossier:list");
100  contact.setIContact(p.getIContact());
101  contact.addEventListener(Events.ON_CHANGE, new EventListener() {
102  @Override
103  public void onEvent(Event event) throws Exception {
104  IContact ci = contact.getIContact();
105  p.setIdContact(ci.getId());
106  if(ci.isValid()) {
107  p.setName(ci.getName());
108  }
109  }
110 
111  });
112  vbox.appendChild(contact);
113 
114  final Checkbox cbAttach = new Checkbox(I_.get("Show all attachments"));
115  cbAttach.setStyle("font-size:11px;color:#444;");
116  cbAttach.setChecked(p.isShowAllAttachments());
117  cbAttach.addEventListener(Events.ON_CHECK, new EventListener() {
118 
119  @Override
120  public void onEvent(Event event) throws Exception {
121  p.setShowAllAttachments(cbAttach.isChecked());
122  }
123 
124  });
125  vbox.appendChild(cbAttach);
126 
127  final Checkbox cbIssues = new Checkbox(I_.get("Show all issues"));
128  cbIssues.setStyle("font-size:11px;color:#444;");
129  cbIssues.setChecked(p.isShowAllIssues());
130  cbIssues.addEventListener(Events.ON_CHECK, new EventListener() {
131 
132  @Override
133  public void onEvent(Event event) throws Exception {
134  p.setShowAllIssues(cbIssues.isChecked());
135  }
136 
137  });
138  vbox.appendChild(cbIssues);
139 
140  final Checkbox cbEmails = new Checkbox(I_.get("Receive all emails"));
141  cbEmails.setStyle("font-size:11px;color:#444;");
142  cbEmails.setChecked(p.isReceiveAllEmails());
143  cbEmails.addEventListener(Events.ON_CHECK, new EventListener() {
144 
145  @Override
146  public void onEvent(Event event) throws Exception {
147  p.setReceiveAllEmails(cbEmails.isChecked());
148  }
149 
150  });
151  vbox.appendChild(cbEmails);
152 
153  final Checkbox cbParticipants = new Checkbox(I_.get("Show participants"));
154  cbParticipants.setStyle("font-size:11px;color:#444;");
155  cbParticipants.setChecked(p.isShowParticipants());
156  cbParticipants.addEventListener(Events.ON_CHECK, new EventListener() {
157 
158  @Override
159  public void onEvent(Event event) throws Exception {
160  p.setShowParticipants(cbParticipants.isChecked());
161  }
162 
163  });
164  vbox.appendChild(cbParticipants);
165 
166  final Checkbox cbBinding = new Checkbox(I_.get("Binding votes"));
167  cbBinding.setStyle("font-size:11px;color:#444;");
168  cbBinding.setChecked(p.isBindingVote());
169  cbBinding.addEventListener(Events.ON_CHECK, new EventListener() {
170 
171  @Override
172  public void onEvent(Event event) throws Exception {
173  p.setBindingVote(cbBinding.isChecked());
174  }
175 
176  });
177  vbox.appendChild(cbBinding);
178 
179  final Listbox role = new Listbox();
180  role.setMold("select");
181  role.addEventListener(Events.ON_SELECT, new EventListener() {
182 
183  @Override
184  public void onEvent(Event event) throws Exception {
185  p.setRole((ParticipantRole) role.getSelectedItem().getValue());
186  if(p.getRole().equals(ParticipantRole.PARTICIPANT_SUBJECT)) {
187  contact.setRole("");
188  } else {
189  contact.setRole("dossier:list");
190  }
191  }
192 
193  });
194  row.appendChild(role);
195 
196  for(ParticipantRole pr : ParticipantRole.values()) {
197  Listitem li = new Listitem(I_.byKey(pr.toString()));
198  li.setValue(pr);
199  li.setSelected(li.getValue().equals(p.getRole()));
200  role.appendChild(li);
201  }
202 
203  }
204  }
Set< CategoryParticipant > getParticipants()
Definition: Category.java:116
Here is the call graph for this function:
Here is the caller graph for this function:

◆ beforeSave()

void org.turro.dossier.zul.dossier.CategoryParticipantGrid2.beforeSave ( )

Definition at line 226 of file CategoryParticipantGrid2.java.

226  {
227  Iterator<CategoryParticipant> it = category.getParticipants().iterator();
228  while(it.hasNext()) {
229  CategoryParticipant p = it.next();
230  if(!p.getIContact().isValid()) {
231  it.remove();
232  }
233  }
234  }
Here is the call graph for this function:

◆ setAddToolbar()

void org.turro.dossier.zul.dossier.CategoryParticipantGrid2.setAddToolbar ( boolean  addToolbar)

Definition at line 67 of file CategoryParticipantGrid2.java.

67  {
68  if(addToolbar) {
69  toolbar = new Toolbar();
70  getParent().appendChild(toolbar);
71  addToolbarButtons();
72  }
73  }

◆ setCategory()

void org.turro.dossier.zul.dossier.CategoryParticipantGrid2.setCategory ( Category  category)

Definition at line 59 of file CategoryParticipantGrid2.java.

59  {
60  this.category = category;
61  rows.getChildren().clear();
62  if(category != null) {
63  addRows();
64  }
65  }
Here is the call graph for this function:

The documentation for this class was generated from the following file: