BrightSide Workbench Full Report + Source Code
org.turro.dossier.zul.fields.FieldValueGrid Class Reference
Inheritance diagram for org.turro.dossier.zul.fields.FieldValueGrid:
Collaboration diagram for org.turro.dossier.zul.fields.FieldValueGrid:

Public Member Functions

void setDossier (Dossier dossier)
 
void addRows ()
 
- Public Member Functions inherited from org.turro.zkoss.layout.GridLayout
 GridLayout ()
 
 GridLayout (int columns)
 
 GridLayout (String hflexs)
 
void setColumns (int columns)
 
void setColumns (String hflexs)
 
void setColCaptions (String captions)
 
void setColCaptions (String[] captions)
 
void clearRows ()
 
GridLayout addGroup (String title, boolean open)
 
GridLayout addRow ()
 
GridLayout insertBeforeRow (Row row)
 
GridLayout addCaption (String label)
 
GridLayout addValue (String value)
 
GridLayout addBoldValue (String value)
 
GridLayout addComponent (HtmlBasedComponent comp)
 
GridLayout addSpannedComponent (HtmlBasedComponent comp, int cols)
 
GridLayout addRowSpannedComponent (HtmlBasedComponent comp, int rows)
 
GridLayout addSpace ()
 
Row getCurrentRow ()
 
Rows getRows (boolean create)
 
Object getData ()
 
void setData (Object data)
 

Additional Inherited Members

- Protected Attributes inherited from org.turro.zkoss.layout.GridLayout
Row currentRow
 

Detailed Description

Member Function Documentation

◆ addRows()

void org.turro.dossier.zul.fields.FieldValueGrid.addRows ( )

Definition at line 57 of file elephant-dossier/src/main/java/org/turro/dossier/zul/fields/FieldValueGrid.java.

57  {
58  for(final FieldDef fd : getCategoryFields()) {
59  addRow();
60  getCurrentRow().setValue(fd);
61 
62  addCaption(I_.get(fd.getLabelKey()));
63 
64  if(fd.getJavaClass().equals(String.class)) {
65  final Textbox value = new Textbox();
66  value.setCols(50);
67  value.setText((String) getFieldValue(dossier, fd));
68  value.addEventListener(Events.ON_CHANGE, new EventListener() {
69  @Override
70  public void onEvent(Event event) throws Exception {
71  setFieldValue(dossier, fd, value.getText());
72  }
73  });
74  addComponent(value);
75  } else if(fd.getJavaClass().equals(Long.class)) {
76  final Longbox value = new Longbox();
77  value.setValue((Long) getFieldValue(dossier, fd));
78  value.addEventListener(Events.ON_CHANGE, new EventListener() {
79  @Override
80  public void onEvent(Event event) throws Exception {
81  setFieldValue(dossier, fd, value.getValue());
82  }
83  });
84  addComponent(value);
85  } else if(fd.getJavaClass().equals(Double.class)) {
86  final Doublebox value = new Doublebox();
87  value.setValue((Double) getFieldValue(dossier, fd));
88  value.addEventListener(Events.ON_CHANGE, new EventListener() {
89  @Override
90  public void onEvent(Event event) throws Exception {
91  setFieldValue(dossier, fd, value.getValue());
92  }
93  });
94  addComponent(value);
95  } else if(fd.getJavaClass().equals(Date.class)) {
96  final Datebox value = new DateboxShort();
97  value.setValue((Date) getFieldValue(dossier, fd));
98  value.addEventListener(Events.ON_CHANGE, new EventListener() {
99  @Override
100  public void onEvent(Event event) throws Exception {
101  setFieldValue(dossier, fd, value.getValue());
102  }
103  });
104  addComponent(value);
105  } else if(fd.getJavaClass().equals(Boolean.class)) {
106  final Checkbox value = new Checkbox();
107  Boolean b = (Boolean) getFieldValue(dossier, fd);
108  value.setChecked(b == null ? false : b);
109  value.addEventListener(Events.ON_CHECK, new EventListener() {
110  @Override
111  public void onEvent(Event event) throws Exception {
112  setFieldValue(dossier, fd, value.isChecked());
113  }
114  });
115  addComponent(value);
116  }
117  }
118  }
GridLayout addComponent(HtmlBasedComponent comp)
GridLayout addCaption(String label)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDossier()

void org.turro.dossier.zul.fields.FieldValueGrid.setDossier ( Dossier  dossier)

Definition at line 48 of file elephant-dossier/src/main/java/org/turro/dossier/zul/fields/FieldValueGrid.java.

48  {
49  this.dossier = dossier;
50  clearRows();
51  if(dossier != null) {
52  addRows();
53  invalidate();
54  }
55  }
Here is the call graph for this function:

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