BrightSide Workbench Full Report + Source Code
org.turro.jpa.grid.JpaGrid< V > Class Template Referenceabstract
Inheritance diagram for org.turro.jpa.grid.JpaGrid< V >:
Collaboration diagram for org.turro.jpa.grid.JpaGrid< V >:

Public Member Functions

 JpaGrid (Dao dao, String query, boolean autoSave)
 
boolean isAutoSave ()
 
void setAutoSave (boolean autoSave)
 
Dao getDao ()
 
void setDao (Dao dao)
 
String getQuery ()
 
void setQuery (String query)
 
void save ()
 
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 clearTable ()
 
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 deleteSelectedRow (final Row row)
 
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 rowChanged (Row row)
 
boolean deleteRow (Row row)
 
- 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)
 
void cellChanged (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.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 31 of file JpaGrid.java.

Constructor & Destructor Documentation

◆ JpaGrid()

org.turro.jpa.grid.JpaGrid< V >.JpaGrid ( Dao  dao,
String  query,
boolean  autoSave 
)

Definition at line 37 of file JpaGrid.java.

37  {
38  super();
39  this.dao = dao;
40  this.query = query;
41  this.autoSave = autoSave;
42  }

Member Function Documentation

◆ afterCompose()

void org.turro.jpa.grid.JpaGrid< V >.afterCompose ( )

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

Definition at line 77 of file JpaGrid.java.

77  {
78  addTableRows();
79  super.afterCompose();
80  }

◆ deleteRow()

boolean org.turro.jpa.grid.JpaGrid< V >.deleteRow ( Row  row)
protected

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

Reimplemented in org.turro.crm.zul.sector.TechnologyGrid, and org.turro.crm.zul.sector.ActivitySectorGrid.

Definition at line 91 of file JpaGrid.java.

91  {
92  if(autoSave && row.getValue() != null) {
93  dao.deleteObject(row.getValue());
94  return true;
95  }
96  return false;
97  }
void deleteObject(Object obj)
Definition: Dao.java:162

◆ getDao()

Definition at line 52 of file JpaGrid.java.

52  {
53  return dao;
54  }
Here is the caller graph for this function:

◆ getQuery()

String org.turro.jpa.grid.JpaGrid< V >.getQuery ( )

Definition at line 60 of file JpaGrid.java.

60  {
61  return query;
62  }

◆ isAutoSave()

boolean org.turro.jpa.grid.JpaGrid< V >.isAutoSave ( )

Definition at line 44 of file JpaGrid.java.

44  {
45  return autoSave;
46  }

◆ rowChanged()

void org.turro.jpa.grid.JpaGrid< V >.rowChanged ( Row  row)
protected

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

Reimplemented in org.turro.financials.linetype.LineTypeGrid.

Definition at line 83 of file JpaGrid.java.

83  {
84  if(autoSave && row.getValue() != null && isValid((V) row.getValue())) {
85  row.setValue(dao.saveObject(row.getValue()));
86  updateRow(row);
87  }
88  }
abstract boolean isValid(V v)
Here is the call graph for this function:

◆ save()

void org.turro.jpa.grid.JpaGrid< V >.save ( )

Reimplemented in org.turro.financials.business.CompanyGrid.

Definition at line 68 of file JpaGrid.java.

68  {
69  for(Component row : getRows().getChildren()) {
70  if(isValid((V) ((Row)row).getValue())) {
71  ((Row)row).setValue(dao.saveObject(((Row)row).getValue()));
72  }
73  }
74  }
Rows getRows(boolean create)
Here is the call graph for this function:

◆ setAutoSave()

void org.turro.jpa.grid.JpaGrid< V >.setAutoSave ( boolean  autoSave)

Definition at line 48 of file JpaGrid.java.

48  {
49  this.autoSave = autoSave;
50  }

◆ setDao()

void org.turro.jpa.grid.JpaGrid< V >.setDao ( Dao  dao)

Definition at line 56 of file JpaGrid.java.

56  {
57  this.dao = dao;
58  }

◆ setQuery()

void org.turro.jpa.grid.JpaGrid< V >.setQuery ( String  query)

Definition at line 64 of file JpaGrid.java.

64  {
65  this.query = query;
66  }

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