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

Public Member Functions

 IssueDetailRow (Issue issue)
 
void setValue (Object value)
 

Detailed Description

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

Definition at line 59 of file IssueDetailRow.java.

Constructor & Destructor Documentation

◆ IssueDetailRow()

org.turro.dossier.zul.issue.IssueDetailRow.IssueDetailRow ( Issue  issue)

Definition at line 63 of file IssueDetailRow.java.

63  {
64  this.issue = issue;
65  }

Member Function Documentation

◆ setValue()

void org.turro.dossier.zul.issue.IssueDetailRow.setValue ( Object  value)

Definition at line 68 of file IssueDetailRow.java.

68  {
69  super.setValue(value);
70 
71  setValign("top");
72 
73  if(value instanceof IssueComment) {
74  final IssueComment ic = (IssueComment) value;
75 
76  Vlayout vbox = new Vlayout();
77  appendChild(vbox);
78 
79  Label label = new Label(ic.getParticipantName());
80  label.setSclass("participant");
81  vbox.appendChild(label);
82 
83  label = new Label(DateFormats.format(ic.getModification(), false));
84  label.setSclass("modification");
85  vbox.appendChild(label);
86 
87  vbox = new Vlayout();
88  appendChild(vbox);
89 
90  LabelExtended lext = new LabelExtended();
91  lext.setSclass("comment");
92  lext.setWordWrap(80);
93  lext.setPre(true);
94  lext.setValue(ic.getComment());
95  vbox.appendChild(lext);
96 
97  Hbox hbox = new Hbox();
98  hbox.setSclass("values");
99  boolean hasValues = false;
100 
101  if(ic.getExpenses() != 0) {
102  label = new Label(I_.get("Expenses"));
103  label.setSclass("caption");
104  hbox.appendChild(label);
105  label = new Label(ic.getExpenses() + "");
106  label.setSclass("value");
107  hbox.appendChild(label);
108  hasValues = true;
109  }
110 
111  if(ic.getHours() != 0) {
112  label = new Label(I_.get("Hours"));
113  label.setSclass("caption");
114  hbox.appendChild(label);
115  label = new Label(ic.getHours() + "");
116  label.setSclass("value");
117  hbox.appendChild(label);
118  hasValues = true;
119  }
120 
121  if(ic.getPrice() != 0) {
122  label = new Label(I_.get("Price"));
123  label.setSclass("caption");
124  hbox.appendChild(label);
125  label = new Label(ic.getPrice() + "");
126  label.setSclass("value");
127  hbox.appendChild(label);
128  hasValues = true;
129  }
130 
131  if(hasValues) {
132  vbox.appendChild(hbox);
133  }
134 
135  if(Application.getApplication().isInRole("issue:delete")) {
136  Image img = new Image("/_zul/images/edit-delete.png");
137  img.setStyle("cursor:pointer");
138  img.addEventListener(Events.ON_CLICK, new EventListener() {
139  @Override
140  public void onEvent(Event event) throws Exception {
141  Messages.confirmDeletion().show(() -> {
142  Issue issue = ic.getIssue();
143  issue.getComments().remove(ic);
144  new DossierPU().saveObject(issue);
145  Framework.getCurrent().invalidateSelected();
146  });
147  }
148  });
149  appendChild(img);
150  }
151  } else if(value instanceof IssuePredecessor) {
152  final IssuePredecessor predecessor = (IssuePredecessor) value;
153 
154  Vlayout vbox = new Vlayout();
155  appendChild(vbox);
156 
157  Label label = new Label(DateFormats.format(predecessor.getCreation(), false));
158  label.setSclass("modification");
159  vbox.appendChild(label);
160 
161  vbox = new Vlayout();
162  appendChild(vbox);
163 
164  Hlayout hbox = new Hlayout();
165  hbox.appendChild(Labels.text("#" + predecessor.getCounterFor(issue).getId()).get());
166  hbox.appendChild(Labels.text(predecessor.getCounterFor(issue).getDescription()).get());
167  hbox.appendChild(Labels.text(predecessor.getDescriptionFor(issue)).get());
168  vbox.appendChild(hbox);
169  } else if(value instanceof Attachment) {
170  final Attachment attachment = (Attachment) value;
171 
172  Vlayout vbox = new Vlayout();
173  appendChild(vbox);
174 
175  IContact contact = Contacts.getEmpty();
176  contact.loadByLogin(attachment.getOwner());
177 
178  Label label = new Label(contact != null ? contact.getName() : attachment.getOwner());
179  label.setSclass("participant");
180  vbox.appendChild(label);
181 
182  label = new Label(DateFormats.format(attachment.getModification(), false));
183  label.setSclass("modification");
184  vbox.appendChild(label);
185 
186  vbox = new Vlayout();
187  appendChild(vbox);
188 
189  Hlayout hbox = new Hlayout();
190  label = new Label(attachment.getFileName());
191  label.setSclass("attachment");
192  label.setStyle("cursor:pointer");
193  label.addEventListener(Events.ON_CLICK, new EventListener() {
194  @Override
195  public void onEvent(Event event) throws Exception {
196  doDownload(attachment);
197  }
198  });
199  hbox.appendChild(label);
200  PreviewButton ap = new PreviewButton(attachment);
201  hbox.appendChild(ap);
202  vbox.appendChild(hbox);
203 
204  LabelExtended lext = new LabelExtended();
205  lext.setWordWrap(80);
206  lext.setPre(true);
207  lext.setValue(attachment.getComment());
208  vbox.appendChild(lext);
209 
210  if(attachment.isLocked()) {
211  contact.loadById(attachment.getLocker());
212  hbox = new Hlayout();
213  hbox.appendChild(new Image("/_zul/images/locked.png"));
214  hbox.appendChild(new Label(String.format(I_.format("Locked by %s", contact.getName()))));
215  vbox.appendChild(hbox);
216  } else if(Application.getApplication().isInRole("attach:delete")) {
217  Image img = new Image("/_zul/images/edit-delete.png");
218  img.setStyle("cursor:pointer");
219  img.addEventListener(Events.ON_CLICK, new EventListener() {
220  @Override
221  public void onEvent(Event event) throws Exception {
222  Messages.confirmDeletion().show(() -> {
223  new AttachPU().deleteObject(attachment);
224  Framework.getCurrent().invalidateSelected();
225  });
226  }
227  });
228  appendChild(img);
229  } else {
230  appendChild(new Space());
231  }
232  } else if(value instanceof CommentIt) {
233  final CommentIt commentIt = (CommentIt) value;
234 
235  Vlayout vbox = new Vlayout();
236  appendChild(vbox);
237 
238  Hlayout hbox = new Hlayout();
239  Label label = new Label(commentIt.getName());
240  label.setSclass("participant");
241  hbox.appendChild(label);
242  hbox.appendChild(new Image(Images.getImage("published")));
243  vbox.appendChild(hbox);
244  if(commentIt.getCreator() == null && !Strings.isBlank(commentIt.getEmail())) {
245  label = new Label(commentIt.getEmail());
246  label.setSclass("participant");
247  vbox.appendChild(label);
248  }
249 
250  label = new Label(DateFormats.format(commentIt.getDateCreation(), false));
251  label.setSclass("modification");
252  vbox.appendChild(label);
253 
254  vbox = new Vlayout();
255  appendChild(vbox);
256 
257  LabelExtended lext = new LabelExtended();
258  lext.setSclass("comment");
259  lext.setWordWrap(80);
260  lext.setPre(true);
261  lext.setValue(commentIt.getBody());
262  vbox.appendChild(lext);
263 
264  if(Application.getApplication().isInRole("issue:delete")) {
265  Image img = new Image("/_zul/images/edit-delete.png");
266  img.setStyle("cursor:pointer");
267  img.addEventListener(Events.ON_CLICK, new EventListener() {
268  @Override
269  public void onEvent(Event event) throws Exception {
270  Messages.confirmDeletion().show(() -> {
271  new ContactsPU().deleteObject(commentIt);
272  Framework.getCurrent().invalidateSelected();
273  });
274  }
275  });
276  appendChild(img);
277  } else {
278  appendChild(new Space());
279  }
280  } else if(value instanceof VoteIt) {
281  final VoteIt voteIt = (VoteIt) value;
282 
283  Vlayout vbox = new Vlayout();
284  appendChild(vbox);
285 
286  Hlayout hbox = new Hlayout();
287  Label label = new Label(voteIt.getCreator().getName());
288  label.setSclass("participant");
289  hbox.appendChild(label);
290  hbox.appendChild(new Image(Images.getImage("published")));
291  vbox.appendChild(hbox);
292 
293  label = new Label(DateFormats.format(voteIt.getDateCreation(), false));
294  label.setSclass("modification");
295  vbox.appendChild(label);
296 
297  vbox = new Vlayout();
298  appendChild(vbox);
299 
300  label = new Label();
301  label.setSclass("comment");
302  label.setValue(voteIt.getVote() + " " + I_.get("Votes"));
303  vbox.appendChild(label);
304 
305  if(Application.getApplication().isInRole("issue:delete")) {
306  Image img = new Image("/_zul/images/edit-delete.png");
307  img.setStyle("cursor:pointer");
308  img.addEventListener(Events.ON_CLICK, new EventListener() {
309  @Override
310  public void onEvent(Event event) throws Exception {
311  Messages.confirmDeletion().show(() -> {
312  new ContactsPU().deleteObject(voteIt);
313  Framework.getCurrent().invalidateSelected();
314  });
315  }
316  });
317  appendChild(img);
318  } else {
319  appendChild(new Space());
320  }
321  } else if(value instanceof StarIt) {
322  final StarIt starIt = (StarIt) value;
323 
324  Vlayout vbox = new Vlayout();
325  appendChild(vbox);
326 
327  Hlayout hbox = new Hlayout();
328  Label label = new Label(starIt.getName());
329  label.setSclass("participant");
330  hbox.appendChild(label);
331  hbox.appendChild(new Image(Images.getImage("published")));
332  vbox.appendChild(hbox);
333 
334  label = new Label(DateFormats.format(starIt.getDateCreation(), false));
335  label.setSclass("modification");
336  vbox.appendChild(label);
337 
338  vbox = new Vlayout();
339  appendChild(vbox);
340 
341  label = new Label();
342  label.setSclass("comment");
343  label.setValue(starIt.getStars() + " " + I_.get("Stars"));
344  vbox.appendChild(label);
345 
346  if(Application.getApplication().isInRole("issue:delete")) {
347  Image img = new Image("/_zul/images/edit-delete.png");
348  img.setStyle("cursor:pointer");
349  img.addEventListener(Events.ON_CLICK, new EventListener() {
350  @Override
351  public void onEvent(Event event) throws Exception {
352  Messages.confirmDeletion().show(() -> {
353  new ContactsPU().deleteObject(starIt);
354  Framework.getCurrent().invalidateSelected();
355  });
356  }
357  });
358  appendChild(img);
359  } else {
360  appendChild(new Space());
361  }
362  }
363  }
Set< IssueComment > getComments()
Definition: Issue.java:122
Here is the call graph for this function:

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