19 package org.turro.dossier.zul.dossier;
22 import org.turro.dossier.entity.Dossier;
23 import org.turro.dossier.entity.DossierVersion;
24 import org.turro.dossier.entity.DossierVersionStatus;
25 import org.turro.elephant.zkoss.EntityGrid;
26 import org.turro.zkoss.label.LabelTypes;
27 import org.zkoss.zk.ui.Component;
28 import org.zkoss.zk.ui.event.Event;
29 import org.zkoss.zk.ui.event.EventListener;
30 import org.zkoss.zk.ui.event.Events;
31 import org.zkoss.zul.Hlayout;
32 import org.zkoss.zul.Label;
43 this.dossier = dossier;
47 private void initLabels() {
52 appendChild(createLabel(dv));
58 private Component createLabel(
final DossierVersion dv) {
59 Label l = LabelTypes.getPreLabel(dv.getVersionString());
60 final DossierVersionStatus dvs = dv.getStatus();
61 if(dvs.equals(DossierVersionStatus.VERSION_READY)) {
62 l.setStyle(
"color:#1EBC30");
63 }
else if(dvs.equals(DossierVersionStatus.VERSION_STOPPED)) {
64 l.setStyle(
"color:#DB2828;cursor:pointer");
65 l.addEventListener(Events.ON_CLICK,
new EventListener<Event>() {
67 public void onEvent(Event event) throws Exception {
68 EntityGrid.showEntities(dv.getByStatus(dvs));
71 }
else if(dvs.equals(DossierVersionStatus.VERSION_NOTRECOMMENDED)) {
72 l.setStyle(
"color:#2185D0;cursor:pointer");
73 l.addEventListener(Events.ON_CLICK,
new EventListener<Event>() {
75 public void onEvent(Event event) throws Exception {
76 EntityGrid.showEntities(dv.getByStatus(dvs));
Set< DossierVersion > getActiveVersions()
void setDossier(Dossier dossier)