113 row.getChildren().clear();
115 final EnumSet<ResourceStatus> status = value.getStatus();
118 row.setSclass(value.getType() +
"-row");
120 Hlayout hbox =
new Hlayout();
121 Space s =
new Space();
122 s.setWidth(value.getLevel() * 15 +
"px");
125 if(value instanceof Value) {
126 Toolbarbutton breakdown =
new Toolbarbutton();
128 breakdown.addEventListener(Events.ON_CLICK,
new EventListener() {
130 public void onEvent(Event event)
throws Exception {
135 hbox.appendChild(breakdown);
137 hbox.appendChild(
new Image(
"/_zul/images/" + value.getType() +
".png"));
138 hbox.appendChild(
new LabelTip(value.getName()));
139 if(value.getUsage() !=
null) {
140 hbox.appendChild(
new Space());
141 hbox.appendChild(
new Image(
"/_zul/images/" + value.getUsage().getType() +
".png"));
142 hbox.appendChild(
new LabelTip(value.getUsage().getName()));
144 row.appendChild(hbox);
146 if(value instanceof Value) {
147 if(((Value) value).getExpressedUnits() == 0.0d) {
148 row.appendChild(
new Space());
150 row.appendChild(
new Label(DecimalFormats.format(((Value) value).getExpressedUnits(), unitFormat)));
153 row.appendChild(
new Space());
156 row.appendChild(
new Label(DecimalFormats.format(value.getEstimatedUnits(), unitFormat)));
158 row.appendChild(
new Label(DecimalFormats.format(value.getRealUnits(), unitFormat)));
160 row.appendChild(
new AbstractLabel(DecimalFormats.format(value.getEstimatedCost(),
currencyFormat)) {
162 protected void doSomething() {
163 if(status.contains(ResourceStatus.RESOURCE_NO_ESTIMATED_COST)) {
164 setSclass(
"warnLabel");
165 final Component comp =
this;
166 addEventListener(Events.ON_CLICK,
new EventListener() {
168 public void onEvent(Event event)
throws Exception {
169 showTooltip(comp, value);
176 row.appendChild(
new AbstractLabel(DecimalFormats.format(value.getRealCost(),
currencyFormat)) {
178 protected void doSomething() {
179 if(status.contains(ResourceStatus.RESOURCE_NO_COST)) {
180 setSclass(
"warnLabel");
181 final Component comp =
this;
182 addEventListener(Events.ON_CLICK,
new EventListener() {
184 public void onEvent(Event event)
throws Exception {
185 showTooltip(comp, value);
192 row.appendChild(
new Label(DecimalFormats.format(value.getEstimatedPrice(),
currencyFormat)));
194 row.appendChild(
new Label(DecimalFormats.format(value.getRealPrice(),
currencyFormat)));
196 row.appendChild(getFinalPriceCell(value, status));
198 row.appendChild(
new AbstractLabel(DecimalFormats.formatPercent(value.getRealMargin())) {
200 protected void doSomething() {
201 if(status.contains(ResourceStatus.RESOURCE_UNDER_MARGIN)) {
202 setSclass(
"warnLabel");
203 final Component comp =
this;
204 addEventListener(Events.ON_CLICK,
new EventListener() {
206 public void onEvent(Event event)
throws Exception {
207 showTooltip(comp, value);
214 row.appendChild(
new Label(DecimalFormats.format(value.getMarketPrice(),
currencyFormat)));
boolean isVisible(ValuationItem value)
void changeBreakdownState(ValuationItem value)
String getBreakdownImage(ValuationItem value)