BrightSide Workbench Full Report + Source Code
org.turro.zul.groupit.GroupedLine Class Reference
Inheritance diagram for org.turro.zul.groupit.GroupedLine:
Collaboration diagram for org.turro.zul.groupit.GroupedLine:

Public Member Functions

 GroupedLine (Grouped grouped, boolean allowEdit)
 
void afterCompose ()
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 36 of file GroupedLine.java.

Constructor & Destructor Documentation

◆ GroupedLine()

org.turro.zul.groupit.GroupedLine.GroupedLine ( Grouped  grouped,
boolean  allowEdit 
)

Definition at line 41 of file GroupedLine.java.

41  {
42  this.grouped = grouped;
43  this.allowEdit = allowEdit;
44  setSclass("z-valign-middle");
45  setValign("middle");
46 
47  }

Member Function Documentation

◆ afterCompose()

void org.turro.zul.groupit.GroupedLine.afterCompose ( )

Definition at line 50 of file GroupedLine.java.

50  {
51  final CategoryCombobox category = new CategoryCombobox();
52  category.setCols(50);
53  if(grouped != null && grouped.getParent() != null) {
54  category.setObjectValue(grouped.getParent().getCategory());
55  }
56  category.setDisabled(!allowEdit);
57  appendChild(category);
58  final GroupItBandbox group = new GroupItBandbox();
59  group.afterCompose();
60  group.setCols(70);
61  if(grouped != null) {
62  group.setCategory(category.getObjectValue());
63  group.setObjectValue(grouped.getParent());
64  }
65  group.setDisabled(!allowEdit);
66  appendChild(group);
67  if(allowEdit) {
68  Button save = new Button(null, Images.getImage("save"));
69  appendChild(save);
70  save.addEventListener(Events.ON_CLICK, new EventListener<Event>() {
71  @Override
72  public void onEvent(Event event) throws Exception {
73  grouped.setParent(group.getObjectValue());
74  boolean isNew = Strings.isBlank(grouped.getId());
75  grouped = new ContactsPU().saveObject(grouped);
76  if(isNew) {
77  Events.postEvent(new Event(Events.ON_CHANGE, GroupedLine.this.getParent()));
78  }
79  }
80  });
81  if(!Strings.isBlank(grouped.getId())) {
82  Button delete = new Button(null, Images.getImage("delete"));
83  appendChild(delete);
84  delete.addEventListener(Events.ON_CLICK, new EventListener<Event>() {
85  @Override
86  public void onEvent(Event event) throws Exception {
87  new ContactsPU().deleteObject(grouped);
88  GroupedLine.this.detach();
89  }
90  });
91  }
92  }
93  category.addEventListener(Events.ON_SELECT, new EventListener<Event>() {
94  @Override
95  public void onEvent(Event event) throws Exception {
96  group.setCategory(category.getObjectValue());
97  }
98  });
99  }
Here is the call graph for this function:

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