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.action.Contacts;
24 import org.turro.contacts.Contact;
25 import org.turro.contacts.util.ContactCombobox;
26 import org.turro.elephant.context.ElephantContext;
27 import org.turro.elephant.util.DecimalFormats;
28 import org.turro.financials.entity.Company;
29 import org.turro.financials.entity.Headquarters;
30 import org.turro.i18n.I_;
31 import org.turro.jpa.entity.EntityCollections;
32 import org.turro.plugin.contacts.IContact;
33 import org.turro.zkoss.grid.CollectionGrid;
34 import org.turro.zkoss.grid.EditableCell;
35 import org.turro.zkoss.grid.EditableColumn;
36 import org.turro.zkoss.input.Percentbox;
37 import org.zkoss.zk.ui.HtmlBasedComponent;
38 import org.zkoss.zk.ui.ext.AfterCompose;
39 import org.zkoss.zul.Row;
59 this.company = company;
86 return !Strings.isBlank(v.
getName()) &&
107 return super.createEditor(editableCell);
113 HtmlBasedComponent hbc = (HtmlBasedComponent) editableCell.
getEditor();
123 return super.getEditorValue(editableCell);
141 return super.formatCell(editableCell, value);
144 private void addColumns() {
148 "idContact",
null, 0,
false,
false).setImage(
"/_zul/images/b_headquarters.png");
150 "structureMargin",
"0.00", 2,
false,
false).setWidth(
"160px");
152 "profitMargin",
"0.00", 2,
false,
false).setWidth(
"160px");
154 "alwaysApply",
null, 0,
false,
false).setWidth(
"160px");
155 }
catch (ClassNotFoundException ex) {
156 Logger.getLogger(
HeadquartersGrid.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
160 private void addDetail(Row row) {
161 row.getChildren().clear();
162 HeadquartersDetail detail =
new HeadquartersDetail(row,
this);
163 row.appendChild(detail);
void initiateRow(Row row, Headquarters value)
String formatCell(EditableCell editableCell, Object value)
boolean isValid(Headquarters v)
Object getEditorValue(EditableCell editableCell)
boolean deleteRow(Row row)
HtmlBasedComponent createEditor(EditableCell editableCell)
HeadquartersGrid(Company company)
void setCompany(Company company)
Set< Headquarters > getHeadquarters()
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)