19 package org.turro.erp.task.usage;
21 import java.util.logging.Level;
22 import java.util.logging.Logger;
23 import org.turro.elephant.context.Application;
24 import org.turro.elephant.util.DecimalFormats;
25 import org.turro.elephant.util.Images;
26 import org.turro.erp.entity.RequiredUsage;
27 import org.turro.erp.entity.Resource;
28 import org.turro.erp.entity.Task;
29 import org.turro.erp.humanres.HumanResourceAptitudeCombobox;
30 import org.turro.erp.resource.ResourceCombobox;
31 import org.turro.financials.contract.ProviderCombobox;
32 import org.turro.financials.entity.Contract;
33 import org.turro.financials.entity.LineType;
34 import org.turro.financials.linetype.BillLineTypeListbox;
35 import org.turro.financials.model.document.LineTypeDescription;
36 import org.turro.financials.product.IProduct;
37 import org.turro.financials.product.ProductExtendedCombobox;
38 import org.turro.hr.humanres.HumanResourceAptitude;
39 import org.turro.jpa.entity.EntityCollectionUtil;
40 import org.turro.zkoss.dialog.SelectionDialog;
41 import org.turro.zkoss.grid.CollectionGrid;
42 import org.turro.zkoss.grid.EditableCell;
43 import org.turro.zkoss.grid.EditableColumn;
44 import org.turro.zkoss.input.Percentbox;
45 import org.zkoss.zk.ui.HtmlBasedComponent;
46 import org.zkoss.zk.ui.event.Event;
47 import org.zkoss.zk.ui.event.EventListener;
48 import org.zkoss.zk.ui.event.Events;
49 import org.zkoss.zul.Button;
50 import org.zkoss.zul.Row;
58 private boolean product;
67 this.product = product;
114 super.afterCompose();
152 bltlb.setMold(
"select");
158 if(value !=
null) pb.
setValue((Double) value);
162 return super.createEditor(editableCell);
172 edit.addEventListener(Events.ON_CLICK,
new EventListener() {
174 public void onEvent(Event event)
throws Exception {
175 event.stopPropagation();
182 return super.createRenderer(editableCell);
190 }
else if(value instanceof
Resource) {
193 }
else if(value instanceof
Contract) {
196 }
else if(value instanceof
IProduct) {
199 }
else if(value instanceof
LineType) {
205 return super.formatCell(editableCell, value);
222 return super.getEditorValue(editableCell);
225 private void addColumns() {
243 addColumn(
"", String.class,
null,
null, 2,
false,
true).setWidth(
"50px");
244 }
catch (ClassNotFoundException ex) {
245 Logger.getLogger(UsageGrid.class.getName()).log(Level.SEVERE,
null, ex);
249 private void showTree(RequiredUsage ru) {
251 UsageTree usageTree =
new UsageTree();
252 usageTree.setRequiredUsage(ru);
253 SelectionDialog.showComponent(getPage(), Application.getString(
"lRequiredUsages"), usageTree,
"95%",
"600px",
null);
static String getString(String key)
static String getImage(String image)
boolean isHumanResourceType()
void setContractPreferenceId(long contractPreferenceId)
Set< OrderItem > getOrderItems()
void prepareHumanResource()
long getContractPreferenceId()
void setLineTypeId(long lineTypeId)
Set< RequiredUsage > getRequiredUsages()
void initiateRow(Row row, RequiredUsage value)
HtmlBasedComponent createEditor(EditableCell editableCell)
boolean filterValue(RequiredUsage v)
boolean isValid(RequiredUsage v)
Object getEditorValue(EditableCell editableCell)
boolean deleteRow(Row row)
void setProduct(boolean product)
HtmlBasedComponent createRenderer(EditableCell editableCell)
String formatCell(EditableCell editableCell, Object value)
String getPartialDescription()
ContractPreference getContractPreference()
void setData(Contract contract, long lineTypeId, long contractPreferenceId)
void setContractorId(long contractorId)
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)
String getProductString()