18 package org.turro.financials.account;
20 import org.turro.string.Strings;
21 import org.turro.financials.book.BookListbox;
22 import org.turro.financials.entity.BookDefinition;
23 import org.turro.financials.entity.MajorAccount;
24 import org.turro.i18n.I_;
25 import org.turro.zkoss.grid.CollectionGrid;
26 import org.turro.zkoss.grid.EditableCell;
27 import org.zkoss.zk.ui.HtmlBasedComponent;
28 import org.zkoss.zk.ui.ext.AfterCompose;
29 import org.zkoss.zul.Row;
37 private static final int MAX_LEVELS = 2;
72 boolean bookEdit = level < MAX_LEVELS ? cellIndex == 3 : cellIndex == 2;
75 blb.setMold(
"select");
80 return super.createEditor(editableCell);
86 boolean bookEdit = level < MAX_LEVELS ? cellIndex == 3 : cellIndex == 2;
87 if(bookEdit && value !=
null) {
90 return super.formatCell(editableCell, value);
93 private void addColumns() {
96 "account",
null, 0,
false,
false).setWidth(
"200px");
98 "description",
null, 0,
false,
false);
99 addColumn(
I_.
get(
"Book"), org.turro.financials.entity.BookDefinition.class,
100 "bookDefinition",
null, 0,
false,
false).setWidth(
"300px");
103 private void addDetail(Row row) {
104 if(level < MAX_LEVELS) {
105 row.getChildren().clear();
106 MajorDetail detail =
new MajorDetail(row,
this, level + 1);
107 row.appendChild(detail);
HtmlBasedComponent createEditor(EditableCell editableCell)
boolean isValid(MajorAccount v)
String formatCell(EditableCell editableCell, Object value)
void initiateRow(Row row, MajorAccount value)
boolean deleteRow(Row row)
MajorAccountDetailGrid(MajorAccount major, int level)
List< MajorAccount > getDescendants()
static String get(String msg)
EditableColumn addColumn(String label, Class javaClass, String property, String format, int scale, boolean onlyDate, boolean readOnly)
Object getCellValue(EditableCell editableCell)