19 package org.turro.valuation;
21 import org.turro.elephant.util.DecimalFormats;
22 import org.turro.i18n.I_;
23 import org.turro.zkoss.grid.PagingGrid;
24 import org.turro.zkoss.input.ExpressionInput;
25 import org.turro.zkoss.label.LabelTip;
26 import org.zkoss.zk.ui.event.Event;
27 import org.zkoss.zk.ui.event.EventListener;
28 import org.zkoss.zk.ui.event.Events;
29 import org.zkoss.zul.*;
39 unitFormat =
"#0.000";
49 rows.getChildren().clear();
51 for(ResourceRef resRef :
model.getResources()) {
52 processResource(resRef);
58 private void processResource(
final ResourceRef resRef) {
62 row.setSclass(resRef.getType() +
"-res-row");
64 Hlayout hbox =
new Hlayout();
65 hbox.appendChild(
new Image(
"/_zul/images/" + resRef.getType() +
".png"));
66 hbox.appendChild(
new LabelTip(resRef.getName()));
67 row.appendChild(hbox);
74 finalPrice.setInplace(
true);
75 finalPrice.
setValue(resRef.getFinalPrice());
76 finalPrice.setCols(12);
77 finalPrice.addEventListener(Events.ON_CHANGE,
new EventListener() {
79 public void onEvent(Event event)
throws Exception {
80 resRef.setFinalPrice(((Number) finalPrice.
getNumber()).doubleValue());
81 Events.postEvent(
new Event(Events.ON_CHANGE,
ResourcesGrid.this));
84 row.appendChild(finalPrice);
90 Auxhead ah =
new Auxhead();
93 Auxheader ahr =
new Auxheader();
96 ahr =
new Auxheader(
I_.
get(
"Units"));
97 ahr.setAlign(
"center");
101 ahr =
new Auxheader(
I_.
get(
"Price"));
102 ahr.setAlign(
"center");
106 Columns cols =
new Columns();
107 cols.setSizable(
true);
110 Column col =
new Column();
111 col.setLabel(
I_.
get(
"Resource"));
113 cols.appendChild(col);
116 col.setLabel(
I_.
get(
"Estimated"));
118 cols.appendChild(col);
121 col.setLabel(
I_.
get(
"Real"));
123 cols.appendChild(col);
126 col.setLabel(
I_.
get(
"Market"));
128 cols.appendChild(col);
131 col.setLabel(
I_.
get(
"Final"));
133 cols.appendChild(col);
static String get(String msg)
void setValuationModel(ValuationModel model)
Rows getRows(boolean create)
void setRowCount(int rows)