BrightSide Workbench Full Report + Source Code
org.turro.financials.payroll.PayrollExpiriesGrid Class Reference
Inheritance diagram for org.turro.financials.payroll.PayrollExpiriesGrid:
Collaboration diagram for org.turro.financials.payroll.PayrollExpiriesGrid:

Public Member Functions

 PayrollExpiriesGrid ()
 
Collection< DocumentRelationgetRelations ()
 
Document getDocument ()
 
void setDocument (Document document)
 
void notifyChange ()
 
void updateBox ()
 
void updateLines ()
 
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, SingleLineDocumentWrapper value)
 
boolean deleteRow (Row row)
 
boolean isValid (SingleLineDocumentWrapper v)
 
String formatCell (EditableCell editableCell, Object value)
 
HtmlBasedComponent createEditor (EditableCell editableCell)
 
void cellChanged (EditableCell editableCell, Object value)
 
- Protected Member Functions inherited from org.turro.zkoss.grid.CollectionGrid< V >
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 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 53 of file PayrollExpiriesGrid.java.

Constructor & Destructor Documentation

◆ PayrollExpiriesGrid()

org.turro.financials.payroll.PayrollExpiriesGrid.PayrollExpiriesGrid ( )

Definition at line 61 of file PayrollExpiriesGrid.java.

61  {
62  super();
63  }

Member Function Documentation

◆ afterCompose()

void org.turro.financials.payroll.PayrollExpiriesGrid.afterCompose ( )

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

Definition at line 137 of file PayrollExpiriesGrid.java.

137  {
138  setReadOnly(false);
139  try {
140  addColumns();
141  } catch (ClassNotFoundException ex) {
142  Logger.getLogger(PayrollExpiriesGrid.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
143  }
144  super.afterCompose();
145  getColumns().setVisible(false);
146  }
void setReadOnly(boolean readOnly)
Columns getColumns(boolean create)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cellChanged()

void org.turro.financials.payroll.PayrollExpiriesGrid.cellChanged ( EditableCell  editableCell,
Object  value 
)
protected

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

Definition at line 190 of file PayrollExpiriesGrid.java.

190  {
191  super.cellChanged(editableCell, value);
192  updateRow(editableCell.getRow());
193  if(value instanceof Contract) {
194  lastStore = (Contract) value;
195  }
196  }
Here is the call graph for this function:

◆ createEditor()

HtmlBasedComponent org.turro.financials.payroll.PayrollExpiriesGrid.createEditor ( EditableCell  editableCell)
protected

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

Definition at line 164 of file PayrollExpiriesGrid.java.

164  {
165  if(editableCell.getColumn() instanceof EditableColumn) {
166  EditableColumn ec = (EditableColumn) editableCell.getColumn();
167  if(ec.getJavaClass().equals(Contract.class)) {
168  SingleLineDocumentWrapper sldw = (SingleLineDocumentWrapper) editableCell.getRow().getValue();
169  Object value = getCellValue(editableCell);
170  ContractListbox slb = new ContractListbox(
171  new ContractUsualSet(stores, true,
172  sldw.getTarget().getUsualPath() + "st:"));
173  if(value != null) {
174  slb.setObjectValue((Contract) value);
175  }
176  slb.setMold("select");
177  return slb;
178  } else if("price".equals(ec.getProperty())) {
179  SingleLineDocumentWrapper sldw = (SingleLineDocumentWrapper) editableCell.getRow().getValue();
180  if(sldw.getTotal() == 0) {
181  sldw.setPrice(getCurrentDifference());
182  }
183  return super.createEditor(editableCell);
184  }
185  }
186  return super.createEditor(editableCell);
187  }
Object getCellValue(EditableCell editableCell)
Here is the call graph for this function:

◆ deleteRow()

boolean org.turro.financials.payroll.PayrollExpiriesGrid.deleteRow ( Row  row)
protected

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

Definition at line 125 of file PayrollExpiriesGrid.java.

125  {
126  SingleLineDocumentWrapper dr = (SingleLineDocumentWrapper) row.getValue();
127  dr.removeRelation();
128  return true;
129  }
Here is the call graph for this function:

◆ formatCell()

String org.turro.financials.payroll.PayrollExpiriesGrid.formatCell ( EditableCell  editableCell,
Object  value 
)
protected

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

Definition at line 149 of file PayrollExpiriesGrid.java.

149  {
150  if(value instanceof DocumentDefinition) {
151  DocumentDefinition dd = (DocumentDefinition) value;
152  return dd.getName();
153  } else if(value instanceof LineType) {
154  LineType lt = ((LineType) value);
155  return lt.getName();
156  } else if(value instanceof Contract) {
157  Contract ctc = ((Contract) value);
158  return ctc.getPartialDescription();
159  }
160  return super.formatCell(editableCell, value);
161  }
Here is the call graph for this function:

◆ getDocument()

Document org.turro.financials.payroll.PayrollExpiriesGrid.getDocument ( )

Definition at line 73 of file PayrollExpiriesGrid.java.

73  {
74  return document;
75  }

◆ getRelations()

Collection<DocumentRelation> org.turro.financials.payroll.PayrollExpiriesGrid.getRelations ( )

Definition at line 65 of file PayrollExpiriesGrid.java.

65  {
66  ArrayList<DocumentRelation> list = new ArrayList<DocumentRelation>();
67  for(SingleLineDocumentWrapper sldw : getValues()) {
68  list.add(sldw.getRelation());
69  }
70  return list;
71  }
Here is the call graph for this function:

◆ initiateRow()

void org.turro.financials.payroll.PayrollExpiriesGrid.initiateRow ( Row  row,
SingleLineDocumentWrapper  value 
)
protected

Definition at line 111 of file PayrollExpiriesGrid.java.

111  {
112  if(value == null) {
113  value = new SingleLineDocumentWrapper(document, expiryDefinition);
114  //value.setStore(lastStore);
115  if(!Strings.isBlank(document.getDocumentNumber())) {
116  value.setDocumentNumber(document.getDocumentNumber() + "/" + getRowCount());
117  }
118  value.setLineType(lineType);
119  lineType.setContractPreference(value.getLine().getDocument().getDefaultContractPreference());
120  }
121  row.setValue(value);
122  }
void setContractPreference(ContractPreference contractPreference)
Definition: LineType.java:81
Here is the call graph for this function:

◆ isValid()

boolean org.turro.financials.payroll.PayrollExpiriesGrid.isValid ( SingleLineDocumentWrapper  v)
protected

Definition at line 132 of file PayrollExpiriesGrid.java.

132  {
133  return v != null && v.isValid();
134  }
Here is the call graph for this function:

◆ notifyChange()

void org.turro.financials.payroll.PayrollExpiriesGrid.notifyChange ( )

Definition at line 93 of file PayrollExpiriesGrid.java.

93  {
94  Events.postEvent(new Event(Events.ON_CHANGE, this));
95  updateBox();
96  }
Here is the call graph for this function:

◆ setDocument()

void org.turro.financials.payroll.PayrollExpiriesGrid.setDocument ( Document  document)

Definition at line 77 of file PayrollExpiriesGrid.java.

77  {
78  this.document = document;
79  Dao dao = new FinancialsPU();
80  expiryDefinition = dao.find(DocumentDefinition.class, 8L);
81  lineType = dao.find(LineType.class, 7L);
82  stores = new DocumentDefinitionWrapper(expiryDefinition)
83  .getRelatedStores(document.getContract());
84  if(stores.isEmpty()) {
85  stores = new DocumentDefinitionWrapper(expiryDefinition)
86  .getRelatedStores();
87  }
88  ContractWrapper.clearInactives(stores);
89  lastStore = CollectionUtil.from(stores).first();
90  setCollection(SingleLineDocumentWrapper.adapt(document, document.getDescendants()));
91  }
Set< DocumentRelation > getDescendants()
Definition: Document.java:139
void setCollection(Collection< V > collection)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateBox()

void org.turro.financials.payroll.PayrollExpiriesGrid.updateBox ( )

Definition at line 98 of file PayrollExpiriesGrid.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateLines()

void org.turro.financials.payroll.PayrollExpiriesGrid.updateLines ( )

Definition at line 104 of file PayrollExpiriesGrid.java.

104  {
105  clearRows();
106  setDocument(document);
107  super.afterCompose();
108  }
Here is the call graph for this function:

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