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

Public Member Functions

 CompanyGrid ()
 
void save ()
 
- Public Member Functions inherited from org.turro.jpa.grid.JpaGrid< V >
 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 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 initiateRow (Row row, Company value)
 
boolean isValid (Company v)
 
HtmlBasedComponent createEditor (EditableCell editableCell)
 
Object getEditorValue (EditableCell editableCell)
 
String formatCell (EditableCell editableCell, Object value)
 
- Protected Member Functions inherited from org.turro.jpa.grid.JpaGrid< V >
void rowChanged (Row row)
 
boolean deleteRow (Row row)
 
- Protected Member Functions inherited from org.turro.zkoss.grid.EditableGrid< V >
Object getCellValue (EditableCell editableCell)
 
void setCellValue (EditableCell editableCell, Object value)
 
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 44 of file CompanyGrid.java.

Constructor & Destructor Documentation

◆ CompanyGrid()

org.turro.financials.business.CompanyGrid.CompanyGrid ( )

Definition at line 46 of file CompanyGrid.java.

46  {
47  super(new FinancialsPU(),
48  "select company from Company as company " +
49  "order by company.name", false);
50  setDefaultBehavior(false);
51  addColumns();
52  }
void setDefaultBehavior(boolean defaultBehavior)
Here is the call graph for this function:

Member Function Documentation

◆ createEditor()

HtmlBasedComponent org.turro.financials.business.CompanyGrid.createEditor ( EditableCell  editableCell)
protected

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

Definition at line 96 of file CompanyGrid.java.

96  {
97  if(editableCell.getCellIndex() == 1) {
98  Object value = getCellValue(editableCell);
99  ContactCombobox cdc = new ContactCombobox();
100  if(value != null) cdc.setIdContact(((Company) editableCell.getRow().getValue()).getIdContact());
101  return cdc;
102  }
103  return super.createEditor(editableCell);
104  }
Object getCellValue(EditableCell editableCell)
Here is the call graph for this function:

◆ formatCell()

String org.turro.financials.business.CompanyGrid.formatCell ( EditableCell  editableCell,
Object  value 
)
protected

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

Definition at line 123 of file CompanyGrid.java.

123  {
124  if(editableCell.getCellIndex() == 1) {
125  IContact ci = Contacts.getContactById((String) value);
126  if(ci.isValid()) {
127  return ci.getName();
128  }
129  return "";
130  }
131  return super.formatCell(editableCell, value);
132  }
Here is the call graph for this function:

◆ getEditorValue()

Object org.turro.financials.business.CompanyGrid.getEditorValue ( EditableCell  editableCell)
protected

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

Definition at line 107 of file CompanyGrid.java.

107  {
108  if(editableCell.getCellIndex() == 1) {
109  HtmlBasedComponent hbc = (HtmlBasedComponent) editableCell.getEditor();
110  if(hbc instanceof ContactCombobox) {
111  Contact c = ((ContactCombobox) hbc).getContact();
112  if(c != null) {
113  ((Company) editableCell.getRow().getValue()).setName(c.getName());
114  return c.getId();
115  }
116  }
117  return null;
118  }
119  return super.getEditorValue(editableCell);
120  }
Here is the call graph for this function:

◆ initiateRow()

void org.turro.financials.business.CompanyGrid.initiateRow ( Row  row,
Company  value 
)
protected

Definition at line 84 of file CompanyGrid.java.

84  {
85  if(value == null) value = new Company();
86  row.setValue(value);
87  addDetail(row);
88  }

◆ isValid()

boolean org.turro.financials.business.CompanyGrid.isValid ( Company  v)
protected

Definition at line 91 of file CompanyGrid.java.

91  {
92  return !Strings.isBlank(v.getName());
93  }
Here is the call graph for this function:

◆ save()

void org.turro.financials.business.CompanyGrid.save ( )

Reimplemented from org.turro.jpa.grid.JpaGrid< V >.

Definition at line 55 of file CompanyGrid.java.

55  {
56  for(Company c : getValues()) {
57  Iterator<Service> its = c.getServices().iterator();
58  while(its.hasNext()) {
59  Service s = its.next();
60  if(Strings.isBlank(s.getName())) {
61  its.remove();
62  }
63  }
64  Iterator<Headquarters> ith = c.getHeadquarters().iterator();
65  while(ith.hasNext()) {
66  Headquarters h = ith.next();
67  if(Strings.isBlank(h.getIdContact())) {
68  ith.remove();
69  } else {
70  Iterator<Department> itd = h.getDepartments().iterator();
71  while(itd.hasNext()) {
72  Department d = itd.next();
73  if(Strings.isBlank(d.getName())) {
74  itd.remove();
75  }
76  }
77  }
78  }
79  }
80  super.save();
81  }
Here is the call graph for this function:

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