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.Department;
26 import org.turro.financials.entity.Headquarters;
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;
72 return !Strings.isBlank(v.
getName()) &&
86 return super.createEditor(editableCell);
97 return super.formatCell(editableCell, value);
100 private void addColumns() {
104 "name",
null, 0,
false,
false).setImage(
"/_zul/images/b_department.png");
106 "structureMargin",
"0.00", 2,
false,
false).setWidth(
"160px");
108 "profitMargin",
"0.00", 2,
false,
false).setWidth(
"160px");
110 "alwaysApply",
null, 0,
false,
false).setWidth(
"160px");
111 }
catch (ClassNotFoundException ex) {
112 Logger.getLogger(
DepartmentGrid.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
116 private void addDetail(Row row) {
117 row.getChildren().clear();
118 DepartmentDetail detail =
new DepartmentDetail(row,
this);
119 row.appendChild(detail);
DepartmentGrid(Headquarters headquarters)
HtmlBasedComponent createEditor(EditableCell editableCell)
void initiateRow(Row row, Department value)
String formatCell(EditableCell editableCell, Object value)
boolean isValid(Department v)
boolean deleteRow(Row row)
void setHeadquarters(Headquarters headquarters)
Headquarters getHeadquarters()
Set< Department > getDepartments()
static String get(String msg)
static EntityCollections entities(Collection values)
EditableColumn addColumn(String label, Class javaClass, String property, String format, int scale, boolean onlyDate, boolean readOnly)
Object getCellValue(EditableCell editableCell)
void setDefaultBehavior(boolean defaultBehavior)