BrightSide Workbench Full Report + Source Code
org.turro.erp.task.usage.ReceiptGrid Class Reference
Inheritance diagram for org.turro.erp.task.usage.ReceiptGrid:
Collaboration diagram for org.turro.erp.task.usage.ReceiptGrid:

Public Member Functions

 ReceiptGrid ()
 
Task getTask ()
 
void setTask (Task task)
 
WorkOrder getWorkOrder ()
 
void setWorkOrder (WorkOrder workOrder)
 
void afterCompose ()
 
- Public Member Functions inherited from org.turro.zkoss.grid.CollectionGrid< V >
 CollectionGrid ()
 
 CollectionGrid (Collection< V > collection)
 
Collection< V > getCollection ()
 
void setCollection (Collection< V > collection)
 
void updateCollection (Collection< V > collection)
 
Row getDependingRow ()
 
void setDependingRow (Row dependingRow)
 
void clearTable ()
 
void deleteSelectedRow (Row row)
 
- Public Member Functions inherited from org.turro.zkoss.grid.EditableGrid< V >
 EditableGrid ()
 
boolean isAllowDeletions ()
 
void setAllowDeletions (boolean allowDeletions)
 
boolean isAllowInsertions ()
 
void setAllowInsertions (boolean allowInsertions)
 
EditableCell getCurrentCell ()
 
Row getLastRow ()
 
boolean isReadOnly ()
 
void setReadOnly (boolean readOnly)
 
boolean isSelectInput ()
 
void setSelectInput (boolean selectInput)
 
boolean isShowZeros ()
 
void setShowZeros (boolean showZeros)
 
void clearFoot ()
 
void clearRows ()
 
void clearValidRows ()
 
void clearColumns ()
 
List< V > getValues ()
 
List< V > getAllValues ()
 
EventListener getEditListener ()
 
EventListener getNextListener ()
 
EventListener getKeyListener ()
 
EventListener getBlurListener ()
 
EventListener getCancelListener ()
 
void processEdition (EditableCell editableCell)
 
void cancelEdition ()
 
HtmlBasedComponent getEditor (EditableCell editableCell)
 
Row appendValue ()
 
Row addNewRow ()
 
void insertInSelectedRow (Row row)
 
Column getEditableColumn (int cellIndex)
 
void updateRow (Row row)
 
void updateRows ()
 
EditableColumn addColumn (String label, Class javaClass, String property, String format, int scale, boolean onlyDate, boolean readOnly)
 
EditableColumn addColumn (String label, String javaClass, String property, String format, int scale, boolean onlyDate, boolean readOnly) throws ClassNotFoundException
 
EditableColumn addColumn (String image, String tooltip, Class javaClass, String property, String format, int scale, boolean onlyDate, boolean readOnly)
 
EditableColumn addColumn (String image, String tooltip, String javaClass, String property, String format, int scale, boolean onlyDate, boolean readOnly) throws ClassNotFoundException
 
- Public Member Functions inherited from org.turro.zkoss.grid.PagingGrid
void setColumns (int columns)
 
void setColumns (String hflexs)
 
void refine ()
 
boolean isDefaultBehavior ()
 
void setDefaultBehavior (boolean defaultBehavior)
 
String getRefineValue ()
 
void setRefineValue (String value)
 
int getMaxResults ()
 
void setMaxResults (int maxResults)
 
String getPagingMold ()
 
void setPagingMold (String pagingMold)
 
int getRowCount ()
 
void setRowCount (int rows)
 
void setHeadersVisible (boolean value)
 
boolean isHeadersVisible ()
 
String getVarColumns ()
 
void setVarColumns (String varColumns)
 
Collection< String > getVarColumnsList (String defaultCols)
 
void addDetailColumn ()
 
void addDetailColumn (HtmlBasedComponent caption)
 
void openDetails ()
 
boolean isEmpty ()
 
void clearEmptyGroups ()
 
Columns getColumns (boolean create)
 
Rows getRows (boolean create)
 
Foot getFoot (boolean create)
 
Foot createFoot ()
 
void exportToPdf ()
 

Protected Member Functions

void initiateRow (Row row, ReceiptItem value)
 
boolean deleteRow (Row row)
 
boolean isValid (ReceiptItem v)
 
HtmlBasedComponent createEditor (EditableCell editableCell)
 
HtmlBasedComponent createRenderer (EditableCell editableCell)
 
String formatCell (EditableCell editableCell, Object value)
 
Object getEditorValue (EditableCell editableCell)
 
- Protected Member Functions inherited from org.turro.zkoss.grid.CollectionGrid< V >
void cellChanged (EditableCell editableCell, Object value)
 
void rowChanged (Row row)
 
boolean filterValue (V v)
 
- Protected Member Functions inherited from org.turro.zkoss.grid.EditableGrid< V >
Object getCellValue (EditableCell editableCell)
 
void setCellValue (EditableCell editableCell, Object value)
 
boolean isCellValid (EditableCell editableCell, Object value)
 
boolean canDeleteRow (Row row)
 
boolean canEditRow (Row row)
 
abstract void initiateRow (Row row, V value)
 
abstract boolean isValid (V v)
 

Additional Inherited Members

- Public Attributes inherited from org.turro.zkoss.grid.EditableGrid< V >
EditEventListener editListener
 
NextEventListener nextListener
 
KeyEventListener keyListener
 
CancelEventListener cancelListener
 
BlurEventListener blurListener
 
boolean allowInsertions
 
- Protected Attributes inherited from org.turro.zkoss.grid.CollectionGrid< V >
Row dependingRow
 
- Protected Attributes inherited from org.turro.zkoss.grid.EditableGrid< V >
EditableCell currentCell
 
String ctrlKeys
 
Row lastRow
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 55 of file ReceiptGrid.java.

Constructor & Destructor Documentation

◆ ReceiptGrid()

org.turro.erp.task.usage.ReceiptGrid.ReceiptGrid ( )

Definition at line 60 of file ReceiptGrid.java.

60  {
61  setAllowInsertions(false);
62  }
void setAllowInsertions(boolean allowInsertions)
Here is the call graph for this function:

Member Function Documentation

◆ afterCompose()

void org.turro.erp.task.usage.ReceiptGrid.afterCompose ( )

Reimplemented from org.turro.zkoss.grid.CollectionGrid< V >.

Definition at line 99 of file ReceiptGrid.java.

99  {
100  addColumns();
101  setCollection(task == null ? new ReceiptItemAdapter(task) : new ReceiptItemAdapter(workOrder));
102  super.afterCompose();
103  }
void setCollection(Collection< V > collection)
Here is the call graph for this function:

◆ createEditor()

HtmlBasedComponent org.turro.erp.task.usage.ReceiptGrid.createEditor ( EditableCell  editableCell)
protected

Reimplemented from org.turro.zkoss.grid.EditableGrid< V >.

Definition at line 106 of file ReceiptGrid.java.

106  {
107  if(editableCell.getColumn() instanceof EditableColumn) {
108  EditableColumn ec = (EditableColumn) editableCell.getColumn();
109  RequiredUsage ru = editableCell.getRow().getValue();
110  if(ec.getJavaClass().equals(HumanResourceAptitude.class)) {
111  Object value = getCellValue(editableCell);
112  HumanResourceAptitudeCombobox hrac = new HumanResourceAptitudeCombobox();
113  hrac.setTask(task);
114  if(value != null) hrac.setObjectValue((HumanResourceAptitude) value);
115  return hrac;
116  } else if(ec.getJavaClass().equals(Resource.class)) {
117  Object value = getCellValue(editableCell);
118  ResourceCombobox rcb = new ResourceCombobox();
119  if(value != null) rcb.setObjectValue((Resource) value);
120  return rcb;
121  } else if(ec.getJavaClass().equals(Contract.class)) {
122  Object value = getCellValue(editableCell);
123  ProviderCombobox pcb = new ProviderCombobox();
124  if(value != null) pcb.setObjectValue((Contract) value);
125  return pcb;
126  } else if(ec.getJavaClass().equals(IProduct.class)) {
127  Object value = getCellValue(editableCell);
128  ProductExtendedCombobox pecb = new ProductExtendedCombobox();
129  pecb.setContractorId(ru.getProviderId());
130  if(value != null) pecb.setObjectValue((IProduct) value);
131  return pecb;
132  } else if(ec.getJavaClass().equals(LineType.class)) {
133  Object value = getCellValue(editableCell);
134  BillLineTypeListbox bltlb = new BillLineTypeListbox();
135  bltlb.setMold("select");
136  bltlb.setData(ru.getProvider(), ru.getLineTypeId(), ru.getContractPreferenceId());
137  return bltlb;
138  } else if(editableCell.getColumn().getLabel().equals(Application.getString("lDedication"))) {
139  Object value = getCellValue(editableCell);
140  Percentbox pb = new Percentbox();
141  if(value != null) pb.setValue((Double) value);
142  return pb;
143  }
144  }
145  return super.createEditor(editableCell);
146  }
Object getCellValue(EditableCell editableCell)
Here is the call graph for this function:

◆ createRenderer()

HtmlBasedComponent org.turro.erp.task.usage.ReceiptGrid.createRenderer ( EditableCell  editableCell)
protected

Reimplemented from org.turro.zkoss.grid.EditableGrid< V >.

Definition at line 149 of file ReceiptGrid.java.

149  {
150  if(editableCell.getColumn() instanceof EditableColumn) {
151  EditableColumn ec = (EditableColumn) editableCell.getColumn();
152  final ReceiptItem ri = editableCell.getRow().getValue();
153  if(editableCell.getCellIndex() == 0) {
154  return getResourceBox(ri, false);
155  }
156  }
157  return super.createRenderer(editableCell);
158  }
Here is the call graph for this function:

◆ deleteRow()

boolean org.turro.erp.task.usage.ReceiptGrid.deleteRow ( Row  row)
protected

Reimplemented from org.turro.zkoss.grid.EditableGrid< V >.

Definition at line 89 of file ReceiptGrid.java.

89  {
90  return false;
91  }

◆ formatCell()

String org.turro.erp.task.usage.ReceiptGrid.formatCell ( EditableCell  editableCell,
Object  value 
)
protected

Reimplemented from org.turro.zkoss.grid.EditableGrid< V >.

Definition at line 161 of file ReceiptGrid.java.

161  {
162  if(value instanceof HumanResourceAptitude) {
163  HumanResourceAptitude res = ((HumanResourceAptitude) value);
164  return res.getRealName();
165  } else if(value instanceof Resource) {
166  Resource res = ((Resource) value);
167  return res.getName();
168  } else if(value instanceof Contract) {
169  Contract ctc = ((Contract) value);
170  return ctc.getPartialDescription();
171  } else if(value instanceof IProduct) {
172  IProduct p = ((IProduct) value);
173  return p.getProductString();
174  } else if(value instanceof LineType) {
175  RequiredUsage ru = editableCell.getRow().getValue();
176  return new LineTypeDescription(ru.getLineTypeId(), ru.getContractPreferenceId()).getDescription();
177  } else if(editableCell.getColumn().getLabel().equals(Application.getString("lDedication"))) {
178  return DecimalFormats.format(((Double) value) * 100.0) + "%";
179  }
180  return super.formatCell(editableCell, value);
181  }
Here is the call graph for this function:

◆ getEditorValue()

Object org.turro.erp.task.usage.ReceiptGrid.getEditorValue ( EditableCell  editableCell)
protected

Reimplemented from org.turro.zkoss.grid.EditableGrid< V >.

Definition at line 184 of file ReceiptGrid.java.

184  {
185  if(editableCell.getJavaClass().equals(LineType.class)) {
186  RequiredUsage ru = editableCell.getRow().getValue();
187  BillLineTypeListbox bltlb = (BillLineTypeListbox) editableCell.getEditor();
188  LineType lt = bltlb.getObjectValue();
189  if(lt != null) {
190  ru.setLineTypeId(lt.getId());
191  if(lt.getContractPreference() != null) {
192  ru.setContractPreferenceId(lt.getContractPreference().getId());
193  }
194  }
195  return lt;
196  }
197  return super.getEditorValue(editableCell);
198  }
Here is the call graph for this function:

◆ getTask()

Task org.turro.erp.task.usage.ReceiptGrid.getTask ( )

Definition at line 64 of file ReceiptGrid.java.

64  {
65  return task;
66  }

◆ getWorkOrder()

WorkOrder org.turro.erp.task.usage.ReceiptGrid.getWorkOrder ( )

Definition at line 72 of file ReceiptGrid.java.

72  {
73  return workOrder;
74  }

◆ initiateRow()

void org.turro.erp.task.usage.ReceiptGrid.initiateRow ( Row  row,
ReceiptItem  value 
)
protected

Definition at line 81 of file ReceiptGrid.java.

81  {
82  if(value == null) {
83  throw new RuntimeException("Empty row on receipt!");
84  }
85  row.setValue(value);
86  }

◆ isValid()

boolean org.turro.erp.task.usage.ReceiptGrid.isValid ( ReceiptItem  v)
protected

Definition at line 94 of file ReceiptGrid.java.

94  {
95  return !v.isEmpty();
96  }
Here is the call graph for this function:

◆ setTask()

void org.turro.erp.task.usage.ReceiptGrid.setTask ( Task  task)

Definition at line 68 of file ReceiptGrid.java.

68  {
69  this.task = task;
70  }

◆ setWorkOrder()

void org.turro.erp.task.usage.ReceiptGrid.setWorkOrder ( WorkOrder  workOrder)

Definition at line 76 of file ReceiptGrid.java.

76  {
77  this.workOrder = workOrder;
78  }

The documentation for this class was generated from the following file: