BrightSide Workbench Full Report + Source Code
org.turro.contacts.form.RelationGrid Class Reference
Inheritance diagram for org.turro.contacts.form.RelationGrid:
Collaboration diagram for org.turro.contacts.form.RelationGrid:

Public Member Functions

void setContact (Contact contact)
 
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

boolean isValid (BusinessRelation v)
 
void initiateRow (Row row, BusinessRelation 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 46 of file RelationGrid.java.

Member Function Documentation

◆ afterCompose()

void org.turro.contacts.form.RelationGrid.afterCompose ( )

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

Definition at line 131 of file RelationGrid.java.

131  {
132  addColumns();
133  super.afterCompose();
134  }

◆ createEditor()

HtmlBasedComponent org.turro.contacts.form.RelationGrid.createEditor ( EditableCell  editableCell)
protected

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

Definition at line 79 of file RelationGrid.java.

79  {
80  if(editableCell.getCellIndex() == 0) {
81  Object value = getCellValue(editableCell);
82  EntityCombobox cdc = new EntityCombobox();
83  cdc.setRoot("contact");
84  if(ContactType.CONTACT_INTERNAL.equals(contact.getType())) {
85  cdc.setParameters(KeyValueMap.of("type", ContactType.CONTACT_INTERNAL.toString()));
86  } else {
87  cdc.setParameters(KeyValueMap.of("type", ContactType.getJuridical()));
88  }
89  cdc.setObjectValue(value);
90  return cdc;
91  } else if(editableCell.getCellIndex() == 1) {
92  Object value = getCellValue(editableCell);
93  OrganigramListbox ol = new OrganigramListbox();
94  ol.setAllowNull(true);
95  ol.setMold("select");
96  ol.setCollection(RelationType.getAllowedTops());
97  ol.setObjectValue(RelationType.getFromString((String) value));
98  return ol;
99  }
100  return super.createEditor(editableCell);
101  }
Object getCellValue(EditableCell editableCell)
Here is the call graph for this function:

◆ deleteRow()

boolean org.turro.contacts.form.RelationGrid.deleteRow ( Row  row)
protected

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

Definition at line 71 of file RelationGrid.java.

71  {
72  BusinessRelation a = (BusinessRelation) row.getValue();
73  EntityCollections.entities(contact.getBusinessRelations()).remove(a);
74  a.setContact(contact);
75  return true;
76  }
Set< BusinessRelation > getBusinessRelations()
Definition: Contact.java:379
Here is the call graph for this function:

◆ formatCell()

String org.turro.contacts.form.RelationGrid.formatCell ( EditableCell  editableCell,
Object  value 
)
protected

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

Definition at line 119 of file RelationGrid.java.

119  {
120  if(value instanceof Contact) {
121  return ((Contact) value).getFullName();
122  } else if(editableCell.getCellIndex() == 1) {
123  if(value != null) {
124  return I_.byKey(RelationType.getFromString((String) value).toString());
125  }
126  }
127  return super.formatCell(editableCell, value);
128  }
Here is the call graph for this function:

◆ getEditorValue()

Object org.turro.contacts.form.RelationGrid.getEditorValue ( EditableCell  editableCell)
protected

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

Definition at line 104 of file RelationGrid.java.

104  {
105  if(editableCell.getCellIndex() == 0) {
106  EntityCombobox ol = (EntityCombobox) editableCell.getEditor();
107  return checkBusiness(ol.getObjectValue()) ? ol.getObjectValue() : null;
108  } else if(editableCell.getCellIndex() == 1) {
109  OrganigramListbox ol = (OrganigramListbox) editableCell.getEditor();
110  RelationType type = ol.getObjectValue();
111  if(type != null) {
112  return type.getRelationKey();
113  }
114  }
115  return super.getEditorValue(editableCell);
116  }
Here is the call graph for this function:

◆ initiateRow()

void org.turro.contacts.form.RelationGrid.initiateRow ( Row  row,
BusinessRelation  value 
)
protected

Definition at line 61 of file RelationGrid.java.

61  {
62  if(value == null) {
63  value = new BusinessRelation();
64  value.setContact(contact);
65  contact.getBusinessRelations().add(value);
66  }
67  row.setValue(value);
68  }
Here is the call graph for this function:

◆ isValid()

boolean org.turro.contacts.form.RelationGrid.isValid ( BusinessRelation  v)
protected

Definition at line 56 of file RelationGrid.java.

56  {
57  return !v.isEmpty();
58  }
Here is the call graph for this function:

◆ setContact()

void org.turro.contacts.form.RelationGrid.setContact ( Contact  contact)

Definition at line 50 of file RelationGrid.java.

50  {
51  this.contact = contact;
53  }
void setCollection(Collection< V > collection)
Here is the call graph for this function:

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