BrightSide Workbench Full Report + Source Code
org.turro.erp.purchase.ProductsGrid Class Reference
Inheritance diagram for org.turro.erp.purchase.ProductsGrid:
Collaboration diagram for org.turro.erp.purchase.ProductsGrid:

Public Member Functions

 ProductsGrid ()
 
boolean isReceipt ()
 
void setReceipt (boolean receipt)
 
- 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)
 
void afterCompose ()
 
- 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, ProductsItem value)
 
boolean deleteRow (Row row)
 
boolean isValid (ProductsItem v)
 
HtmlBasedComponent createEditor (final EditableCell editableCell)
 
String formatCell (EditableCell editableCell, Object value)
 
boolean isCellValid (EditableCell editableCell, Object value)
 
- 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)
 
Object getEditorValue (EditableCell editableCell)
 
void setCellValue (EditableCell editableCell, Object value)
 
HtmlBasedComponent createRenderer (EditableCell editableCell)
 
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 45 of file ProductsGrid.java.

Constructor & Destructor Documentation

◆ ProductsGrid()

org.turro.erp.purchase.ProductsGrid.ProductsGrid ( )

Definition at line 53 of file ProductsGrid.java.

53  {
54  addColumns();
55  }

Member Function Documentation

◆ createEditor()

HtmlBasedComponent org.turro.erp.purchase.ProductsGrid.createEditor ( final EditableCell  editableCell)
protected

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

Definition at line 88 of file ProductsGrid.java.

88  {
89  if(editableCell.getColumn() instanceof EditableColumn) {
90  final ProductsItem productsItem = (ProductsItem) editableCell.getRow().getValue();
91  EditableColumn ec = (EditableColumn) editableCell.getColumn();
92  if(ec.getLabel().equals(Application.getString("lReference"))) {
93  Object value = getCellValue(editableCell);
94  final OrderReferencePositionListbox orplb = new OrderReferencePositionListbox();
95  orplb.setMold("select");
96  orplb.setAllowNull(true);
97  orplb.setNullAtBottom(true);
98  orplb.setNullLabel("lNewReference");
99  orplb.setWorkOrder(productsItem.getWorkOrder());
100  // line value must update with new selection
101  orplb.addEventListener(Events.ON_SELECT, new EventListener() {
102  @Override
103  public void onEvent(Event event) throws Exception {
104  Integer oref = orplb.getObjectValue();
105  if(oref != null) {
106  productsItem.setOrderRef(oref);
107  Events.postEvent(new Event(Events.ON_CHANGING, ProductsGrid.this, editableCell));
108  }
109  }
110  });
111  if(value != null) orplb.setObjectValue((Integer) value);
112  return orplb;
113  } else if(ec.getJavaClass().equals(Task.class)) {
114  Object value = getCellValue(editableCell);
115  TaskListbox tlb = new TaskListbox();
116  tlb.setMold("select");
117  tlb.setAllowNull(true);
118  tlb.setNullAtBottom(true);
119  tlb.setNullLabel("lNewTask");
120  tlb.setOrderReference(productsItem.getOrderReference());
121  if(value != null) tlb.setObjectValue((Task) value);
122  return tlb;
123  } else if(ec.getJavaClass().equals(IProduct.class)) {
124  Object value = getCellValue(editableCell);
125  ProductExtendedCombobox pecb = new ProductExtendedCombobox();
126  if(value != null) pecb.setObjectValue((IProduct) value);
127  return pecb;
128  }
129  }
130  return super.createEditor(editableCell);
131  }
Object getCellValue(EditableCell editableCell)
Here is the call graph for this function:

◆ deleteRow()

boolean org.turro.erp.purchase.ProductsGrid.deleteRow ( Row  row)
protected

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

Definition at line 78 of file ProductsGrid.java.

78  {
79  return true;
80  }

◆ formatCell()

String org.turro.erp.purchase.ProductsGrid.formatCell ( EditableCell  editableCell,
Object  value 
)
protected

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

Definition at line 134 of file ProductsGrid.java.

134  {
135  ProductsItem productsItem = (ProductsItem) editableCell.getRow().getValue();
136  lastWorkOrderId = productsItem.getWorkOrderId();
137  lastOrderRef = productsItem.getOrderRef();
138  lastTask = productsItem.getTask();
139  lastConcept = productsItem.getConcept();
140  if(value instanceof Task) {
141  Task t = ((Task) value);
142  return t.getName();
143  } else if(value instanceof IProduct) {
144  IProduct p = ((IProduct) value);
145  return p.getProductString();
146  }
147  return super.formatCell(editableCell, value);
148  }
Here is the call graph for this function:

◆ initiateRow()

void org.turro.erp.purchase.ProductsGrid.initiateRow ( Row  row,
ProductsItem  value 
)
protected

Definition at line 66 of file ProductsGrid.java.

66  {
67  if(value == null) {
68  value = new ProductsItem();
69  value.setWorkOrderId(lastWorkOrderId);
70  value.setOrderRef(lastOrderRef);
71  value.setTask(lastTask);
72  value.setConcept(lastConcept);
73  }
74  row.setValue(value);
75  }
Here is the call graph for this function:

◆ isCellValid()

boolean org.turro.erp.purchase.ProductsGrid.isCellValid ( EditableCell  editableCell,
Object  value 
)
protected

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

Definition at line 151 of file ProductsGrid.java.

151  {
152  if(editableCell.getColumn() instanceof EditableColumn) {
153  EditableColumn ec = (EditableColumn) editableCell.getColumn();
154  if(ec.getLabel().equals(Application.getString("lWorkOrder"))) {
155  return WorkOrder.getByWorkOrderId((Long) value) != null;
156  }
157  }
158  return super.isCellValid(editableCell, value);
159  }
Here is the call graph for this function:

◆ isReceipt()

boolean org.turro.erp.purchase.ProductsGrid.isReceipt ( )

Definition at line 57 of file ProductsGrid.java.

57  {
58  return receipt;
59  }
Here is the caller graph for this function:

◆ isValid()

boolean org.turro.erp.purchase.ProductsGrid.isValid ( ProductsItem  v)
protected

Definition at line 83 of file ProductsGrid.java.

83  {
84  return v.isValid();
85  }

◆ setReceipt()

void org.turro.erp.purchase.ProductsGrid.setReceipt ( boolean  receipt)

Definition at line 61 of file ProductsGrid.java.

61  {
62  this.receipt = receipt;
63  }

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