19 package org.turro.financials.contract;
21 import java.util.logging.Level;
22 import java.util.logging.Logger;
23 import org.turro.elephant.context.ElephantContext;
24 import org.turro.financials.entity.Contract;
25 import org.turro.financials.entity.Tax;
26 import org.turro.financials.entity.TaxType;
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.zkoss.zk.ui.HtmlBasedComponent;
32 import org.zkoss.zk.ui.ext.AfterCompose;
33 import org.zkoss.zul.Row;
49 this.contract = contract;
54 this.contract = contract;
76 Tax tax = (
Tax) row.getValue();
87 ttl.setMold(
"select");
88 if(value !=
null) ttl.setObjectValue((
TaxType) value);
91 return super.createEditor(editableCell);
103 return super.formatCell(editableCell, value);
106 private void addColumns() {
109 addColumn(
I_.
get(
"Tax"),
"double",
"tax",
null, 2,
false,
false).setHflex(
"1");
110 addColumn(
I_.
get(
"Equivalence surcharge"),
"double",
"equivalenceSurcharge",
null, 2,
false,
false).setHflex(
"1");
111 }
catch (ClassNotFoundException ex) {
112 Logger.getLogger(
ContractTaxesGrid.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
void setContract(Contract contract)
boolean deleteRow(Row row)
void initiateRow(Row row, Tax value)
String formatCell(EditableCell editableCell, Object value)
ContractTaxesGrid(Contract contract)
HtmlBasedComponent createEditor(EditableCell editableCell)
void setContract(Contract contract)
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)