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

Public Member Functions

 BreakdownGrid ()
 
OrderReference getOrderReference ()
 
void setOrderReference (OrderReference orderReference)
 
double getAmount ()
 
void setMode (int mode)
 
void setShowQuantity (boolean show)
 
void setShowPrice (boolean show)
 
- 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, Breakdown value)
 
boolean deleteRow (Row row)
 
boolean isValid (Breakdown v)
 
void rowChanged (Row row)
 
- Protected Member Functions inherited from org.turro.zkoss.grid.CollectionGrid< V >
void cellChanged (EditableCell editableCell, Object value)
 
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)
 
String formatCell (EditableCell editableCell, Object value)
 
HtmlBasedComponent createEditor (EditableCell editableCell)
 
HtmlBasedComponent createRenderer (EditableCell editableCell)
 
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 37 of file BreakdownGrid.java.

Constructor & Destructor Documentation

◆ BreakdownGrid()

org.turro.erp.reference.BreakdownGrid.BreakdownGrid ( )

Definition at line 41 of file BreakdownGrid.java.

41  {
42  addColumns();
43  }

Member Function Documentation

◆ deleteRow()

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

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

Definition at line 123 of file BreakdownGrid.java.

123  {
124  Breakdown t = (Breakdown) row.getValue();
125  EntityCollectionUtil.remove(orderReference.getBreakdowns(), t);
126  return true;
127  }
Here is the call graph for this function:

◆ getAmount()

double org.turro.erp.reference.BreakdownGrid.getAmount ( )

Definition at line 53 of file BreakdownGrid.java.

53  {
54  double amount = 0.0;
55  for(Breakdown b : getValues()) {
56  amount += b.getAmount();
57  }
58  return amount;
59  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getOrderReference()

OrderReference org.turro.erp.reference.BreakdownGrid.getOrderReference ( )

Definition at line 45 of file BreakdownGrid.java.

45  {
46  return orderReference;
47  }
Here is the caller graph for this function:

◆ initiateRow()

void org.turro.erp.reference.BreakdownGrid.initiateRow ( Row  row,
Breakdown  value 
)
protected

Definition at line 113 of file BreakdownGrid.java.

113  {
114  if(value == null) {
115  value = new Breakdown();
116  orderReference.getBreakdowns().add(value);
117  value.setOrderRef(getRowCount());
118  }
119  row.setValue(value);
120  }
Here is the call graph for this function:

◆ isValid()

boolean org.turro.erp.reference.BreakdownGrid.isValid ( Breakdown  v)
protected

Definition at line 130 of file BreakdownGrid.java.

130  {
131  return !v.isEmpty();
132  }
Here is the call graph for this function:

◆ rowChanged()

void org.turro.erp.reference.BreakdownGrid.rowChanged ( Row  row)
protected

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

Definition at line 135 of file BreakdownGrid.java.

135  {
136  super.rowChanged(row);
137  updateRow(row);
138  }
Here is the call graph for this function:

◆ setMode()

void org.turro.erp.reference.BreakdownGrid.setMode ( int  mode)

Definition at line 61 of file BreakdownGrid.java.

61  {
62  if(mode == 1) {
63  // Tasks
64  getRows().getChildren().clear();
65  orderReference.getBreakdowns().clear();
66  for(Task t : orderReference.getTasks()) {
67  Row row = appendValue();
68  Breakdown b = (Breakdown) row.getValue();
69  b.setDescription(t.getName());
70  b.setQuantity(0.0d);
71  b.setPrice(0.0d);
72  updateRow(row);
73  }
74  if(isAllowInsertions()) {
75  addNewRow();
76  }
77  } else if (mode == 2) {
78  // Resources
79  getRows().getChildren().clear();
80  orderReference.getBreakdowns().clear();
81  for(Task t : orderReference.getTasks()) {
82  for(RequiredUsage hru : t.getRequiredUsages()) {
83  Row row = appendValue();
84  Breakdown b = (Breakdown) row.getValue();
85  b.setDescription(hru.getName());
86  b.setQuantity(hru.getRealUnits());
87  b.setPrice(hru.getUnitPrice());
88  updateRow(row);
89  }
90  }
91  if(isAllowInsertions()) {
92  addNewRow();
93  }
94  } else if(mode == 3) {
95  getRows().getChildren().clear();
96  orderReference.getBreakdowns().clear();
97  if(isAllowInsertions()) {
98  addNewRow();
99  }
100  }
101  }
Rows getRows(boolean create)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setOrderReference()

void org.turro.erp.reference.BreakdownGrid.setOrderReference ( OrderReference  orderReference)

Definition at line 49 of file BreakdownGrid.java.

49  {
50  this.orderReference = orderReference;
51  }

◆ setShowPrice()

void org.turro.erp.reference.BreakdownGrid.setShowPrice ( boolean  show)

Definition at line 107 of file BreakdownGrid.java.

107  {
108  ((Column) getColumns().getChildren().get(3)).setVisible(show);
109  ((Column) getColumns().getChildren().get(4)).setVisible(show);
110  }
Columns getColumns(boolean create)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setShowQuantity()

void org.turro.erp.reference.BreakdownGrid.setShowQuantity ( boolean  show)

Definition at line 103 of file BreakdownGrid.java.

103  {
104  ((Column) getColumns().getChildren().get(1)).setVisible(show);
105  }
Here is the call graph for this function:
Here is the caller graph for this function:

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