BrightSide Workbench Full Report + Source Code
org.turro.erp.task.usage.UsageGrid Class Reference
Inheritance diagram for org.turro.erp.task.usage.UsageGrid:
Collaboration diagram for org.turro.erp.task.usage.UsageGrid:

Public Member Functions

boolean isProduct ()
 
void setProduct (boolean product)
 
Task getTask ()
 
void setTask (Task task)
 
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, RequiredUsage value)
 
boolean deleteRow (Row row)
 
boolean isValid (RequiredUsage v)
 
boolean filterValue (RequiredUsage v)
 
HtmlBasedComponent createEditor (EditableCell editableCell)
 
HtmlBasedComponent createRenderer (EditableCell editableCell)
 
String formatCell (EditableCell editableCell, Object value)
 
Object getEditorValue (EditableCell editableCell)
 
- 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)
 
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 56 of file UsageGrid.java.

Member Function Documentation

◆ afterCompose()

void org.turro.erp.task.usage.UsageGrid.afterCompose ( )

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

Definition at line 111 of file UsageGrid.java.

111  {
112  addColumns();
114  super.afterCompose();
115  }
void setCollection(Collection< V > collection)
Here is the call graph for this function:

◆ createEditor()

HtmlBasedComponent org.turro.erp.task.usage.UsageGrid.createEditor ( EditableCell  editableCell)
protected

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

Definition at line 123 of file UsageGrid.java.

123  {
124  if(editableCell.getColumn() instanceof EditableColumn) {
125  EditableColumn ec = (EditableColumn) editableCell.getColumn();
126  RequiredUsage ru = editableCell.getRow().getValue();
127  if(ec.getJavaClass().equals(HumanResourceAptitude.class)) {
128  Object value = getCellValue(editableCell);
129  HumanResourceAptitudeCombobox hrac = new HumanResourceAptitudeCombobox();
130  hrac.setTask(task);
131  if(value != null) hrac.setObjectValue((HumanResourceAptitude) value);
132  return hrac;
133  } else if(ec.getJavaClass().equals(Resource.class)) {
134  Object value = getCellValue(editableCell);
135  ResourceCombobox rcb = new ResourceCombobox();
136  if(value != null) rcb.setObjectValue((Resource) value);
137  return rcb;
138  } else if(ec.getJavaClass().equals(Contract.class)) {
139  Object value = getCellValue(editableCell);
140  ProviderCombobox pcb = new ProviderCombobox();
141  if(value != null) pcb.setObjectValue((Contract) value);
142  return pcb;
143  } else if(ec.getJavaClass().equals(IProduct.class)) {
144  Object value = getCellValue(editableCell);
145  ProductExtendedCombobox pecb = new ProductExtendedCombobox();
146  pecb.setContractorId(ru.getProviderId());
147  if(value != null) pecb.setObjectValue((IProduct) value);
148  return pecb;
149  } else if(ec.getJavaClass().equals(LineType.class)) {
150  Object value = getCellValue(editableCell);
151  BillLineTypeListbox bltlb = new BillLineTypeListbox();
152  bltlb.setMold("select");
153  bltlb.setData(ru.getProvider(), ru.getLineTypeId(), ru.getContractPreferenceId());
154  return bltlb;
155  } else if(editableCell.getColumn().getLabel().equals(Application.getString("lDedication"))) {
156  Object value = getCellValue(editableCell);
157  Percentbox pb = new Percentbox();
158  if(value != null) pb.setValue((Double) value);
159  return pb;
160  }
161  }
162  return super.createEditor(editableCell);
163  }
Object getCellValue(EditableCell editableCell)
Here is the call graph for this function:

◆ createRenderer()

HtmlBasedComponent org.turro.erp.task.usage.UsageGrid.createRenderer ( EditableCell  editableCell)
protected

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

Definition at line 166 of file UsageGrid.java.

166  {
167  if(editableCell.getColumn() instanceof EditableColumn) {
168  EditableColumn ec = (EditableColumn) editableCell.getColumn();
169  final RequiredUsage ru = editableCell.getRow().getValue();
170  if(ec.getJavaClass().equals(String.class)) {
171  Button edit = new Button(null, Images.getImage("edit"));
172  edit.addEventListener(Events.ON_CLICK, new EventListener() {
173  @Override
174  public void onEvent(Event event) throws Exception {
175  event.stopPropagation();
176  showTree(ru);
177  }
178  });
179  return edit;
180  }
181  }
182  return super.createRenderer(editableCell);
183  }
Here is the call graph for this function:

◆ deleteRow()

boolean org.turro.erp.task.usage.UsageGrid.deleteRow ( Row  row)
protected

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

Definition at line 94 of file UsageGrid.java.

94  {
95  RequiredUsage ru = (RequiredUsage) row.getValue();
96  if(ru.getOrderItems().isEmpty()) {
97  EntityCollectionUtil.remove(task.getRequiredUsages(), ru);
98  ru.setTask(null);
99  return true;
100  } else {
101  return false;
102  }
103  }
Here is the call graph for this function:

◆ filterValue()

boolean org.turro.erp.task.usage.UsageGrid.filterValue ( RequiredUsage  v)
protected

Definition at line 118 of file UsageGrid.java.

118  {
119  return (v.isProductType() && product) || (v.isHumanResourceType() && !product);
120  }
Here is the call graph for this function:

◆ formatCell()

String org.turro.erp.task.usage.UsageGrid.formatCell ( EditableCell  editableCell,
Object  value 
)
protected

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

Definition at line 186 of file UsageGrid.java.

186  {
187  if(value instanceof HumanResourceAptitude) {
188  HumanResourceAptitude res = ((HumanResourceAptitude) value);
189  return res.getRealName();
190  } else if(value instanceof Resource) {
191  Resource res = ((Resource) value);
192  return res.getName();
193  } else if(value instanceof Contract) {
194  Contract ctc = ((Contract) value);
195  return ctc.getPartialDescription();
196  } else if(value instanceof IProduct) {
197  IProduct p = ((IProduct) value);
198  return p.getProductString();
199  } else if(value instanceof LineType) {
200  RequiredUsage ru = editableCell.getRow().getValue();
201  return new LineTypeDescription(ru.getLineTypeId(), ru.getContractPreferenceId()).getDescription();
202  } else if(editableCell.getColumn().getLabel().equals(Application.getString("lDedication"))) {
203  return DecimalFormats.format(((Double) value) * 100.0) + "%";
204  }
205  return super.formatCell(editableCell, value);
206  }
Here is the call graph for this function:

◆ getEditorValue()

Object org.turro.erp.task.usage.UsageGrid.getEditorValue ( EditableCell  editableCell)
protected

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

Definition at line 209 of file UsageGrid.java.

209  {
210  if(editableCell.getJavaClass().equals(LineType.class)) {
211  RequiredUsage ru = editableCell.getRow().getValue();
212  BillLineTypeListbox bltlb = (BillLineTypeListbox) editableCell.getEditor();
213  LineType lt = bltlb.getObjectValue();
214  if(lt != null) {
215  ru.setLineTypeId(lt.getId());
216  if(lt.getContractPreference() != null) {
217  ru.setContractPreferenceId(lt.getContractPreference().getId());
218  }
219  }
220  return lt;
221  }
222  return super.getEditorValue(editableCell);
223  }
Here is the call graph for this function:

◆ getTask()

Task org.turro.erp.task.usage.UsageGrid.getTask ( )

Definition at line 70 of file UsageGrid.java.

70  {
71  return task;
72  }

◆ initiateRow()

void org.turro.erp.task.usage.UsageGrid.initiateRow ( Row  row,
RequiredUsage  value 
)
protected

Definition at line 79 of file UsageGrid.java.

79  {
80  if(value == null) {
81  value = new RequiredUsage();
82  value.setTask(task);
83  task.getRequiredUsages().add(value);
84  if(product) {
85  value.prepareProduct();
86  } else {
87  value.prepareHumanResource();
88  }
89  }
90  row.setValue(value);
91  }
Here is the call graph for this function:

◆ isProduct()

boolean org.turro.erp.task.usage.UsageGrid.isProduct ( )

Definition at line 62 of file UsageGrid.java.

62  {
63  return product;
64  }

◆ isValid()

boolean org.turro.erp.task.usage.UsageGrid.isValid ( RequiredUsage  v)
protected

Definition at line 106 of file UsageGrid.java.

106  {
107  return !v.isEmpty();
108  }
Here is the call graph for this function:

◆ setProduct()

void org.turro.erp.task.usage.UsageGrid.setProduct ( boolean  product)

Definition at line 66 of file UsageGrid.java.

66  {
67  this.product = product;
68  }

◆ setTask()

void org.turro.erp.task.usage.UsageGrid.setTask ( Task  task)

Definition at line 74 of file UsageGrid.java.

74  {
75  this.task = task;
76  }

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