19 package org.turro.financials.contract;
21 import java.text.DateFormatSymbols;
22 import java.util.Collection;
24 import java.util.logging.Level;
25 import java.util.logging.Logger;
26 import org.turro.string.Strings;
27 import org.turro.elephant.context.Application;
28 import org.turro.elephant.context.ElephantContext;
29 import org.turro.elephant.util.DecimalFormats;
30 import org.turro.financials.document.ConceptCombobox;
31 import org.turro.financials.document.DocumentDefinitionListbox;
32 import org.turro.financials.entity.ContractExpiry;
33 import org.turro.financials.entity.ContractFlow;
34 import org.turro.financials.entity.DocumentDefinition;
35 import org.turro.financials.entity.LineType;
36 import org.turro.financials.linetype.LineTypeListbox;
37 import org.turro.i18n.I_;
38 import org.turro.jpa.entity.EntityCollections;
39 import org.turro.scheduler.constraints.WeekDay;
40 import org.turro.scheduler.zul.constraints.WeekDayListbox;
41 import org.turro.usual.UsualUsages;
42 import org.turro.zkoss.grid.CollectionGrid;
43 import org.turro.zkoss.grid.EditableCell;
44 import org.turro.zkoss.input.DaysOfMonthBandbox;
45 import org.turro.zkoss.input.DaysOfMonthListbox;
46 import org.turro.zkoss.input.MonthBandbox;
47 import org.turro.zkoss.input.MonthListbox;
48 import org.turro.zkoss.input.Percentbox;
49 import org.zkoss.zk.ui.HtmlBasedComponent;
50 import org.zkoss.zk.ui.ext.AfterCompose;
51 import org.zkoss.zul.Row;
67 this.contractFlow = contractFlow;
72 this.contractFlow = contractFlow;
108 ddl.setMold(
"select");
122 if(value !=
null) dmb.
setObjectValue((Collection<Integer>) value);
127 wdl.setAllowNull(
true);
128 wdl.setMold(
"select");
129 if(value !=
null) wdl.
setDayIndex((Integer) value);
134 if(value !=
null) dmb.
setObjectValue((Collection<Integer>) value);
139 if(value !=
null) pc.
setValue((Double) value);
148 ltl.setMold(
"select");
151 return super.createEditor(editableCell);
160 return super.getEditorValue(editableCell);
178 int wd = (Integer) value;
180 return Strings.capitalize(dfs.getWeekdays()[
WeekDay.
map(wd)]);
192 return ((
LineType) value).getName();
196 return super.formatCell(editableCell, value);
199 private void addColumns() {
202 addColumn(
I_.
get(
"Concept"), String.class,
"concept",
null, 0,
false,
false).setHflex(
"2");
203 addColumn(
I_.
get(
"+Days"),
"int",
"daysToAdd",
null, 0,
false,
false).setWidth(
"80px");
204 addColumn(
I_.
get(
"Day of month"), Set.class,
"daysOfMonth",
null, 0,
false,
false).setWidth(
"130px");
205 addColumn(
I_.
get(
"Day of week"),
"int",
"dayOfWeek",
null, 0,
false,
false).setWidth(
"130px");
206 addColumn(
I_.
get(
"Excluded months"), Set.class,
"excludedMonths",
null, 0,
false,
false).setWidth(
"130px");
207 addColumn(
I_.
get(
"Percent"),
"double",
"percentValue",
null, 2,
false,
false).setWidth(
"130px");
208 addColumn(
I_.
get(
"Amount"),
"double",
"amountValue",
null, 2,
false,
false).setWidth(
"130px");
210 }
catch (ClassNotFoundException ex) {
211 Logger.getLogger(ContractTaxesGrid.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
static Locale getUsedLocale()
String formatCell(EditableCell editableCell, Object value)
void initiateRow(Row row, ContractExpiry value)
Object getEditorValue(EditableCell editableCell)
HtmlBasedComponent createEditor(EditableCell editableCell)
void setContractFlow(ContractFlow contractFlow)
boolean isValid(ContractExpiry v)
boolean deleteRow(Row row)
ContractExpiriesGrid(ContractFlow contractFlow)
void setObjectValue(String value)
void setDocumentDefinition(DocumentDefinition documentDefinition)
void setDayOfWeek(int dayOfWeek)
void setContractFlow(ContractFlow contractFlow)
DocumentDefinition getDocumentDefinition()
Set< ContractExpiry > getContractExpiries()
DocumentDefinition getDocumentDefinition()
ContractDefinition getContractDefinition()
String getUsualPath(DocumentDefinition documentDefinition)
static String get(String msg)
static EntityCollections entities(Collection values)
void setDayIndex(int index)
static String getMostUsedvalue(String path)
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)