18 package org.turro.financials.business;
20 import java.util.logging.Level;
21 import java.util.logging.Logger;
22 import org.turro.string.Strings;
23 import org.turro.elephant.context.ElephantContext;
24 import org.turro.elephant.util.DecimalFormats;
25 import org.turro.financials.entity.Company;
26 import org.turro.financials.entity.Service;
27 import org.turro.i18n.I_;
28 import org.turro.jpa.entity.EntityCollections;
29 import org.turro.zkoss.grid.CollectionGrid;
30 import org.turro.zkoss.grid.EditableCell;
31 import org.turro.zkoss.grid.EditableColumn;
32 import org.turro.zkoss.input.Percentbox;
33 import org.zkoss.zk.ui.HtmlBasedComponent;
34 import org.zkoss.zk.ui.ext.AfterCompose;
35 import org.zkoss.zul.Row;
55 this.company = company;
82 return !Strings.isBlank(v.
getName()) &&
96 return super.createEditor(editableCell);
107 return super.formatCell(editableCell, value);
110 private void addColumns() {
114 "name",
null, 0,
false,
false).setImage(
"/_zul/images/b_service.png");
116 "structureMargin",
"0.00", 2,
false,
false).setWidth(
"160px");
118 "profitMargin",
"0.00", 2,
false,
false).setWidth(
"160px");
120 "alwaysApply",
null, 0,
false,
false).setWidth(
"160px");
122 "internal",
null, 0,
false,
false).setWidth(
"80px");
123 }
catch (ClassNotFoundException ex) {
124 Logger.getLogger(
ServiceGrid.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
128 private void addDetail(Row row) {
129 row.getChildren().clear();
130 ServiceDetail detail =
new ServiceDetail(row,
this);
131 row.appendChild(detail);
String formatCell(EditableCell editableCell, Object value)
void setCompany(Company company)
void initiateRow(Row row, Service value)
boolean deleteRow(Row row)
HtmlBasedComponent createEditor(EditableCell editableCell)
boolean isValid(Service v)
ServiceGrid(Company company)
Set< Service > getServices()
void setCompany(Company company)
static String get(String msg)
static EntityCollections entities(Collection values)
void setCollection(Collection< V > collection)
EditableColumn addColumn(String label, Class javaClass, String property, String format, int scale, boolean onlyDate, boolean readOnly)
Object getCellValue(EditableCell editableCell)
void setDefaultBehavior(boolean defaultBehavior)