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

Public Member Functions

 OrderReferenceGrid ()
 
 OrderReferenceGrid (WorkOrder workOrder)
 
void setWorkOrder (WorkOrder workOrder)
 
void importFromCustomerOrder ()
 
- 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, OrderReference value)
 
boolean deleteRow (Row row)
 
boolean isValid (OrderReference v)
 
String formatCell (EditableCell editableCell, Object value)
 
HtmlBasedComponent createEditor (EditableCell editableCell)
 
HtmlBasedComponent createRenderer (EditableCell editableCell)
 
boolean canDeleteRow (Row row)
 
boolean canEditRow (Row row)
 
- 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)
 
boolean isCellValid (EditableCell editableCell, Object value)
 
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 53 of file OrderReferenceGrid.java.

Constructor & Destructor Documentation

◆ OrderReferenceGrid() [1/2]

org.turro.erp.reference.OrderReferenceGrid.OrderReferenceGrid ( )

Definition at line 57 of file OrderReferenceGrid.java.

57  {
58  }

◆ OrderReferenceGrid() [2/2]

org.turro.erp.reference.OrderReferenceGrid.OrderReferenceGrid ( WorkOrder  workOrder)

Definition at line 60 of file OrderReferenceGrid.java.

60  {
61  super(workOrder.getOrderReferences());
62  this.workOrder = workOrder;
63  addColumns();
64  }
Set< OrderReference > getOrderReferences()
Definition: WorkOrder.java:124
Here is the call graph for this function:

Member Function Documentation

◆ canDeleteRow()

boolean org.turro.erp.reference.OrderReferenceGrid.canDeleteRow ( Row  row)
protected

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

Definition at line 242 of file OrderReferenceGrid.java.

242  {
243  OrderReference or = (OrderReference) row.getValue();
244  return super.canDeleteRow(row) && !or.hasBugdetStopper();
245  }
Here is the call graph for this function:

◆ canEditRow()

boolean org.turro.erp.reference.OrderReferenceGrid.canEditRow ( Row  row)
protected

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

Definition at line 248 of file OrderReferenceGrid.java.

248  {
249  OrderReference or = (OrderReference) row.getValue();
250  return super.canEditRow(row) && !or.hasBugdetStopper();
251  }
Here is the call graph for this function:

◆ createEditor()

HtmlBasedComponent org.turro.erp.reference.OrderReferenceGrid.createEditor ( EditableCell  editableCell)
protected

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

Definition at line 143 of file OrderReferenceGrid.java.

143  {
144  if(editableCell.getColumn() instanceof EditableColumn) {
145  EditableColumn ec = (EditableColumn) editableCell.getColumn();
146  if(ec.getJavaClass().equals(Contract.class)) {
147  Object value = getCellValue(editableCell);
148  ServiceStoreListbox sslb = new ServiceStoreListbox();
149  if(value != null) sslb.setObjectValue((Contract) value);
150  sslb.setMold("select");
151  return sslb;
152  } else if(ec.getJavaClass().equals(Product.class)) {
153  Object value = getCellValue(editableCell);
154  ProductCombobox pcb = new ProductCombobox();
155  if(value != null) pcb.setObjectValue((Product) value);
156  return pcb;
157  }
158  }
159  return super.createEditor(editableCell);
160  }
Object getCellValue(EditableCell editableCell)
Here is the call graph for this function:

◆ createRenderer()

HtmlBasedComponent org.turro.erp.reference.OrderReferenceGrid.createRenderer ( EditableCell  editableCell)
protected

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

Definition at line 191 of file OrderReferenceGrid.java.

191  {
192  if(editableCell.getColumn() instanceof EditableColumn) {
193  final OrderReference or = editableCell.getRow().getValue();
194  if(editableCell.getCellIndex() == 7) {
195  Button edit = new Button(null, Images.getImage("edit"));
196  edit.addEventListener(Events.ON_CLICK, new EventListener() {
197  @Override
198  public void onEvent(Event event) throws Exception {
199  event.stopPropagation();
200  showTree(or);
201  }
202  });
203  return edit;
204  }
205  }
206  return super.createRenderer(editableCell);
207  }
Here is the call graph for this function:

◆ deleteRow()

boolean org.turro.erp.reference.OrderReferenceGrid.deleteRow ( Row  row)
protected

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

Definition at line 118 of file OrderReferenceGrid.java.

118  {
119  OrderReference or = (OrderReference) row.getValue();
120  EntityCollectionUtil.remove(workOrder.getOrderReferences(), or);
121  or.setWorkOrder(null);
122  return true;
123  }
Here is the call graph for this function:

◆ formatCell()

String org.turro.erp.reference.OrderReferenceGrid.formatCell ( EditableCell  editableCell,
Object  value 
)
protected

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

Definition at line 131 of file OrderReferenceGrid.java.

131  {
132  if(value instanceof Contract) {
133  Contract ctc = (Contract) value;
134  return ctc == null ? null : ctc.getPartialDescription();
135  } else if(value instanceof Product) {
136  Product p = (Product) value;
137  return p == null ? null : p.getDescription();
138  }
139  return super.formatCell(editableCell, value);
140  }
Here is the call graph for this function:

◆ importFromCustomerOrder()

void org.turro.erp.reference.OrderReferenceGrid.importFromCustomerOrder ( )

Definition at line 72 of file OrderReferenceGrid.java.

72  {
73  final PendingCustomerOrderListbox pcolb = new PendingCustomerOrderListbox();
74  pcolb.setMultiple(true);
75  pcolb.setCheckmark(true);
76  pcolb.setSelectFirst(false);
77  pcolb.setContract(workOrder.getContract());
78 
79  SelectionDialog.getComponent(
80  Framework.getCurrent().getPage(),
81  Application.getString("lCustomerOrders"),
82  pcolb,
83  "80%", "80%", new Command() {
84  @Override
85  public Object execute(Context context) {
86  if(pcolb != null) {
87  for(CustomerOrder cu : pcolb.getObjectValues()) {
88  Row row = appendValue();
89  OrderReference or = (OrderReference) row.getValue();
90  or.initFrom(cu);
91  updateRow(row);
92  }
93  if(isAllowInsertions()) {
94  appendValue();
95  }
96  }
97  return null;
98  }
99  });
100  }
Here is the call graph for this function:

◆ initiateRow()

void org.turro.erp.reference.OrderReferenceGrid.initiateRow ( Row  row,
OrderReference  value 
)
protected

Definition at line 103 of file OrderReferenceGrid.java.

103  {
104  if(value == null) {
105  value = new OrderReference();
106  value.setWorkOrder(workOrder);
107  workOrder.getOrderReferences().add(value);
108  value.setOrderRef(getRowCount());
109  if(workOrder.isProductOrder()) {
110  value.setProductId(workOrder.getProductId());
111  }
112  }
113  row.setValue(value);
114  addDetail(row);
115  }
Here is the call graph for this function:

◆ isValid()

boolean org.turro.erp.reference.OrderReferenceGrid.isValid ( OrderReference  v)
protected

Definition at line 126 of file OrderReferenceGrid.java.

126  {
127  return !v.isEmpty();
128  }
Here is the call graph for this function:

◆ setWorkOrder()

void org.turro.erp.reference.OrderReferenceGrid.setWorkOrder ( WorkOrder  workOrder)

Definition at line 66 of file OrderReferenceGrid.java.

66  {
67  this.workOrder = workOrder;
68  setCollection(workOrder.getOrderReferences());
69  addColumns();
70  }
void setCollection(Collection< V > collection)
Here is the call graph for this function:

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