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

Public Member Functions

 ContractExpiriesGrid ()
 
 ContractExpiriesGrid (ContractFlow contractFlow)
 
void setContractFlow (ContractFlow contractFlow)
 
- 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

boolean isValid (ContractExpiry v)
 
void initiateRow (Row row, ContractExpiry value)
 
boolean deleteRow (Row row)
 
HtmlBasedComponent createEditor (EditableCell editableCell)
 
Object getEditorValue (EditableCell editableCell)
 
String formatCell (EditableCell editableCell, Object value)
 
- 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)
 
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 57 of file ContractExpiriesGrid.java.

Constructor & Destructor Documentation

◆ ContractExpiriesGrid() [1/2]

org.turro.financials.contract.ContractExpiriesGrid.ContractExpiriesGrid ( )

Definition at line 61 of file ContractExpiriesGrid.java.

61  {
62  super();
63  }

◆ ContractExpiriesGrid() [2/2]

org.turro.financials.contract.ContractExpiriesGrid.ContractExpiriesGrid ( ContractFlow  contractFlow)

Definition at line 65 of file ContractExpiriesGrid.java.

65  {
66  super(contractFlow.getContractExpiries());
67  this.contractFlow = contractFlow;
68  addColumns();
69  }
Set< ContractExpiry > getContractExpiries()
Here is the call graph for this function:

Member Function Documentation

◆ createEditor()

HtmlBasedComponent org.turro.financials.contract.ContractExpiriesGrid.createEditor ( EditableCell  editableCell)
protected

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

Definition at line 102 of file ContractExpiriesGrid.java.

102  {
103  if(editableCell.getCellIndex() == 0) {
104  Object value = getCellValue(editableCell);
105  DocumentDefinitionListbox ddl = new DocumentDefinitionListbox(
106  contractFlow.getContract().getContractDefinition(),
107  contractFlow.getDocumentDefinition());
108  ddl.setMold("select");
109  if(value != null) ddl.setObjectValue((DocumentDefinition) value);
110  return ddl;
111  } else if(editableCell.getCellIndex() == 1) {
112  Object value = getCellValue(editableCell);
113  ContractExpiry ce = editableCell.getRow().getValue();
114  ConceptCombobox slb = new ConceptCombobox();
115  slb.setObjectValue(UsualUsages.getMostUsedvalue(contractFlow.getContract().getUsualPath(ce.getDocumentDefinition()) + "cp:"));
116  slb.setDocumentDefinition(ce.getDocumentDefinition());
117  if(value != null) slb.setObjectValue((String) value);
118  return slb;
119  } else if(editableCell.getCellIndex() == 3) {
120  Object value = getCellValue(editableCell);
121  DaysOfMonthBandbox dmb = new DaysOfMonthBandbox();
122  if(value != null) dmb.setObjectValue((Collection<Integer>) value);
123  return dmb;
124  } else if(editableCell.getCellIndex() == 4) {
125  Object value = getCellValue(editableCell);
126  WeekDayListbox wdl = new WeekDayListbox();
127  wdl.setAllowNull(true);
128  wdl.setMold("select");
129  if(value != null) wdl.setDayIndex((Integer) value);
130  return wdl;
131  } else if(editableCell.getCellIndex() == 5) {
132  Object value = getCellValue(editableCell);
133  MonthBandbox dmb = new MonthBandbox();
134  if(value != null) dmb.setObjectValue((Collection<Integer>) value);
135  return dmb;
136  } else if(editableCell.getCellIndex() == 6) {
137  Object value = getCellValue(editableCell);
138  Percentbox pc = new Percentbox();
139  if(value != null) pc.setValue((Double) value);
140  return pc;
141  } else if(editableCell.getCellIndex() == 8) {
142  Object value = getCellValue(editableCell);
143  ContractExpiry ce = editableCell.getRow().getValue();
144  LineTypeListbox ltl = new LineTypeListbox(ce.getDocumentDefinition());
145  if(value != null) {
146  ltl.setObjectValue((LineType) value);
147  }
148  ltl.setMold("select");
149  return ltl;
150  }
151  return super.createEditor(editableCell);
152  }
ContractDefinition getContractDefinition()
Definition: Contract.java:125
String getUsualPath(DocumentDefinition documentDefinition)
Definition: Contract.java:488
Object getCellValue(EditableCell editableCell)
Here is the call graph for this function:

◆ deleteRow()

boolean org.turro.financials.contract.ContractExpiriesGrid.deleteRow ( Row  row)
protected

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

Definition at line 94 of file ContractExpiriesGrid.java.

94  {
95  ContractExpiry ce = (ContractExpiry) row.getValue();
96  EntityCollections.entities(contractFlow.getContractExpiries()).remove(ce);
97  ce.setContractFlow(null);
98  return true;
99  }
Here is the call graph for this function:

◆ formatCell()

String org.turro.financials.contract.ContractExpiriesGrid.formatCell ( EditableCell  editableCell,
Object  value 
)
protected

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

Definition at line 164 of file ContractExpiriesGrid.java.

164  {
165  if(editableCell.getCellIndex() == 0) {
166  DocumentDefinition dd = (DocumentDefinition) value;
167  if(dd != null) {
168  return dd.getName();
169  }
170  return "";
171  } else if(editableCell.getCellIndex() == 3) {
172  if(value != null) {
173  return DaysOfMonthListbox.getStringValues((Collection<Integer>) value);
174  }
175  } else if(editableCell.getCellIndex() == 4) {
176  if(value != null) {
177  DateFormatSymbols dfs = new DateFormatSymbols(Application.getUsedLocale());
178  int wd = (Integer) value;
179  if(wd > -1) {
180  return Strings.capitalize(dfs.getWeekdays()[WeekDay.map(wd)]);
181  }
182  }
183  return "";
184  } else if(editableCell.getCellIndex() == 5) {
185  if(value != null) {
186  return MonthListbox.getStringValues((Collection<Integer>) value);
187  }
188  } else if(editableCell.getCellIndex() == 6) {
189  return DecimalFormats.format(((Double) value) * 100.0) + "%";
190  } else if(editableCell.getCellIndex() == 8) {
191  if(value != null) {
192  return ((LineType) value).getName();
193  }
194  return "";
195  }
196  return super.formatCell(editableCell, value);
197  }
Here is the call graph for this function:

◆ getEditorValue()

Object org.turro.financials.contract.ContractExpiriesGrid.getEditorValue ( EditableCell  editableCell)
protected

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

Definition at line 155 of file ContractExpiriesGrid.java.

155  {
156  if(editableCell.getCellIndex() == 4) {
157  WeekDayListbox wdl = (WeekDayListbox) editableCell.getEditor();
158  return wdl.getDayIndex();
159  }
160  return super.getEditorValue(editableCell);
161  }
Here is the call graph for this function:

◆ initiateRow()

void org.turro.financials.contract.ContractExpiriesGrid.initiateRow ( Row  row,
ContractExpiry  value 
)
protected

Definition at line 83 of file ContractExpiriesGrid.java.

83  {
84  if(value == null) {
85  value = new ContractExpiry();
86  value.setDayOfWeek(-1);
87  value.setContractFlow(contractFlow);
88  contractFlow.getContractExpiries().add(value);
89  }
90  row.setValue(value);
91  }
Here is the call graph for this function:

◆ isValid()

boolean org.turro.financials.contract.ContractExpiriesGrid.isValid ( ContractExpiry  v)
protected

Definition at line 78 of file ContractExpiriesGrid.java.

78  {
79  return !v.isEmpty();
80  }
Here is the call graph for this function:

◆ setContractFlow()

void org.turro.financials.contract.ContractExpiriesGrid.setContractFlow ( ContractFlow  contractFlow)

Definition at line 71 of file ContractExpiriesGrid.java.

71  {
72  this.contractFlow = contractFlow;
73  setCollection(contractFlow.getContractExpiries());
74  addColumns();
75  }
void setCollection(Collection< V > collection)
Here is the call graph for this function:

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