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

Public Member Functions

void setValue (Object value)
 

Detailed Description

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

Definition at line 46 of file IssueRow.java.

Member Function Documentation

◆ setValue()

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

Definition at line 49 of file IssueRow.java.

49  {
50  super.setValue(value);
51 
52  final IssueWrapper wissue = (IssueWrapper) getValue();
53 
54  Hlayout hbox = new Hlayout();
55  appendChild(hbox);
56 
57  Image img = new Image(wissue.getTimmingImage());
58  hbox.appendChild(img);
59  Label label = new Label(wissue.getIssue().getId() + "");
60  hbox.appendChild(label);
61 
62  Vlayout vbox = new Vlayout();
63  appendChild(vbox);
64 
65  hbox = new Hlayout();
66  hbox.setSclass("z-valign-middle");
67  hbox.setValign("middle");
68  vbox.appendChild(hbox);
69 
70  img = new Image(wissue.getAlarmImage());
71  if(!Strings.isBlank(img.getSrc())) {
72  hbox.appendChild(img);
73  }
74  img = new Image(wissue.getPriorityImage());
75  if(!Strings.isBlank(img.getSrc())) {
76  hbox.appendChild(img);
77  }
78 
79  hbox.appendChild(new IssueLabel(wissue.getIssue()));
80 
81  if(wissue.getIssue().getVersion() != null) {
82  hbox.appendChild(LabelTypes.getTinyLabel(wissue.getIssue().getVersion().getVersionString()));
83  }
84 
85  hbox.appendChild(new Space());
86  hbox.appendChild(new AddInformation(wissue.getIssue()) {
87  @Override
88  protected void refreshBase() {
89  IssueRow.this.getChildren().clear();
90  IssueRow.this.setValue(wissue);
91  }
92  });
93 
94  if(wissue.getIssue().getDossier() != null) {
95  DossierLabel dl = new DossierLabel(wissue.getIssue().getDossier(), true);
96  dl.setSclass("softLabel");
97  vbox.appendChild(dl);
98  }
99 
100  if(IssueType.TYPE_DOCUMENT.equals(wissue.getIssue().getType())) {
101  //DocumentBox box = new DocumentBox();
102  Toolbarbutton a = new Toolbarbutton(I_.get("Attachments"), "/_zul/images/clip.png");
103  a.addEventListener(Events.ON_CLICK, new EventListener() {
104  @Override
105  public void onEvent(Event event) throws Exception {
106  IssueAttachTree iat = new IssueAttachTree();
107  iat.setEntity(wissue.getIssue());
108  iat.setChanges(new Changes());
109  SelectionDialog.showComponent(getPage(), I_.get("Attachments"),
110  iat, "80%", "80%", null);
111  }
112  });
113  //box.appendChild(a);
114  //box.setPath(DossierPU.getObjectPath(wissue.getIssue()));
115  vbox.appendChild(a);
116  //box.afterCompose();
117  }
118 
119  LabelExtended lext;
120 
121  if(!wissue.canStartBySources()) {
122  for(String s : wissue.getWaitingReason()) {
123  lext = new LabelExtended();
124  lext.setStyle("color:#444;font-size:11px;");
125  lext.setValue(s);
126  lext.setMaxChars(70);
127  lext.setShowTooltip(true);
128  vbox.appendChild(lext);
129  }
130  }
131 
132  lext = new LabelExtended();
133  lext.setDate(wissue.getIssue().getIssueDate());
134  appendChild(lext);
135 
136  lext = new LabelExtended();
137  lext.setDate(wissue.getIssue().getStartDate());
138  appendChild(lext);
139 
140  lext = new LabelExtended();
141  lext.setDate(wissue.getIssue().getDelivery());
142  appendChild(lext);
143 
144  lext = new LabelExtended();
145  lext.setDate(wissue.getIssue().getControlDate());
146  appendChild(lext);
147 
148  vbox = new Vlayout();
149  appendChild(vbox);
150 
151  lext = new LabelExtended();
152  lext.setStyle("color:navy");
153  lext.setResourceValue(wissue.getIssue().getType().toString());
154  vbox.appendChild(lext);
155 
156  lext = new LabelExtended();
157  lext.setResourceValue(wissue.getIssue().getStatus().toString());
158  vbox.appendChild(lext);
159 
160  if(wissue.getIssue().getStatus().isFinished()) {
161  lext = new LabelExtended();
162  lext.setStyle("color:gray");
163  lext.setResourceValue(wissue.getIssue().getResolution().toString());
164  vbox.appendChild(lext);
165  }
166 
167  if(Application.getApplication().isInRole("issue:delete")) {
168  img = new Image("/_zul/images/edit-delete.png");
169  img.setStyle("cursor:pointer");
170  img.addEventListener(Events.ON_CLICK, new EventListener() {
171  @Override
172  public void onEvent(Event event) throws Exception {
173  Messages.confirmDeletion().show(() -> {
174  SystemLogger.getInstance().doLog(SystemLogType.LOG_INFO, wissue.getIssue(), "deleted",
175  wissue.getIssue().getId() + " - " + wissue.getIssue().getDescription());
176  wissue.delete();
177  Framework.getCurrent().invalidateSelected();
178  });
179  }
180 
181  });
182  appendChild(img);
183  }
184 
185  if(value instanceof IssueWrapper) {
186  Issue i = ((IssueWrapper) value).getIssue();
187  if(i.getStatus() == IssueStatus.STATUS_NEW) {
188  setStyle("background-color: #f5eeee");
189  } else if(i.getStatus() == IssueStatus.STATUS_INCOMPLETE) {
190  setStyle("background-color: #f8eeee");
191  } else if(i.getStatus() == IssueStatus.STATUS_STARTED) {
192  setStyle("background-color: #fffff0");
193  } else if(i.getStatus() == IssueStatus.STATUS_REOPENED) {
194  setStyle("background-color: #f0f9e0");
195  } else if(i.getStatus() == IssueStatus.STATUS_RESOLVED) {
196  setStyle("background-color: #e0f5ee");
197  } else if(i.getStatus() == IssueStatus.STATUS_FROZEN) {
198  setStyle("background-color: #a0f5f5");
199  } else if(i.getStatus() == IssueStatus.STATUS_REUNION) {
200  setStyle("background-color: #e5e5a0");
201  } else if(i.getStatus() == IssueStatus.STATUS_CLOSED) {
202  setStyle("background-color: #ffffff");
203  }
204  }
205  }
Here is the call graph for this function:

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