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

Public Member Functions

 FieldValueGrid (String tabKey)
 
void setContact (Contact contact)
 
void addRows ()
 

Detailed Description

Constructor & Destructor Documentation

◆ FieldValueGrid()

org.turro.contacts.zul.fields.FieldValueGrid.FieldValueGrid ( String  tabKey)

Definition at line 52 of file contacts/src/main/java/org/turro/contacts/zul/fields/FieldValueGrid.java.

52  {
53  this.tabKey = tabKey;
54  rows = new Rows();
55  appendChild(rows);
56  }

Member Function Documentation

◆ addRows()

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

Definition at line 66 of file contacts/src/main/java/org/turro/contacts/zul/fields/FieldValueGrid.java.

66  {
67  for(final FieldDef fd : getTabFields()) {
68  final Row row = new Row();
69  row.setValue(fd);
70  rows.appendChild(row);
71 
72  row.appendChild(new Label(I_.get(fd.getLabelKey())));
73 
74  if(fd.getJavaClass().equals(String.class)) {
75  final FieldValueCombobox value = new FieldValueCombobox(fd);
76  value.setCols(50);
77  value.setFieldValue((String) getFieldValue(contact, fd));
78  value.addEventListener(Events.ON_CHANGE, new EventListener() {
79  @Override
80  public void onEvent(Event event) throws Exception {
81  setFieldValue(contact, fd, value.getFieldValue());
82  }
83  });
84  row.appendChild(value);
85  } else if(fd.getJavaClass().equals(Long.class)) {
86  final Longbox value = new Longbox();
87  value.setValue((Long) getFieldValue(contact, fd));
88  value.addEventListener(Events.ON_CHANGE, new EventListener() {
89  @Override
90  public void onEvent(Event event) throws Exception {
91  setFieldValue(contact, fd, value.getValue());
92  }
93  });
94  row.appendChild(value);
95  } else if(fd.getJavaClass().equals(Double.class)) {
96  final Doublebox value = new Doublebox();
97  value.setValue((Double) getFieldValue(contact, fd));
98  value.addEventListener(Events.ON_CHANGE, new EventListener() {
99  @Override
100  public void onEvent(Event event) throws Exception {
101  setFieldValue(contact, fd, value.getValue());
102  }
103  });
104  row.appendChild(value);
105  } else if(fd.getJavaClass().equals(Date.class)) {
106  final Datebox value = new DateboxShort();
107  value.setValue((Date) getFieldValue(contact, fd));
108  value.addEventListener(Events.ON_CHANGE, new EventListener() {
109  @Override
110  public void onEvent(Event event) throws Exception {
111  setFieldValue(contact, fd, value.getValue());
112  }
113  });
114  row.appendChild(value);
115  } else if(fd.getJavaClass().equals(Boolean.class)) {
116  final Checkbox value = new Checkbox();
117  Boolean b = (Boolean) getFieldValue(contact, fd);
118  value.setChecked(b == null ? false : b);
119  value.addEventListener(Events.ON_CHECK, new EventListener() {
120  @Override
121  public void onEvent(Event event) throws Exception {
122  setFieldValue(contact, fd, value.isChecked());
123  }
124  });
125  row.appendChild(value);
126  }
127  }
128  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setContact()

void org.turro.contacts.zul.fields.FieldValueGrid.setContact ( Contact  contact)

Definition at line 58 of file contacts/src/main/java/org/turro/contacts/zul/fields/FieldValueGrid.java.

58  {
59  this.contact = contact;
60  rows.getChildren().clear();
61  if(contact != null && tabKey != null) {
62  addRows();
63  }
64  }
Here is the call graph for this function:
Here is the caller graph for this function:

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