BrightSide Workbench Full Report + Source Code
org.turro.crm.zul.sale.SaleProspectVendorGrid Class Reference
Inheritance diagram for org.turro.crm.zul.sale.SaleProspectVendorGrid:
Collaboration diagram for org.turro.crm.zul.sale.SaleProspectVendorGrid:

Public Member Functions

 SaleProspectVendorGrid ()
 
void setEditable (boolean editable)
 
void setSaleProspect (SaleProspect saleProspect)
 
void setAddToolbar (boolean addToolbar)
 
void addRows ()
 

Detailed Description

Author
llturro

Definition at line 20 of file SaleProspectVendorGrid.java.

Constructor & Destructor Documentation

◆ SaleProspectVendorGrid()

org.turro.crm.zul.sale.SaleProspectVendorGrid.SaleProspectVendorGrid ( )

Definition at line 28 of file SaleProspectVendorGrid.java.

28  {
29  rows = new Rows();
30  appendChild(rows);
31  }

Member Function Documentation

◆ addRows()

void org.turro.crm.zul.sale.SaleProspectVendorGrid.addRows ( )

Definition at line 57 of file SaleProspectVendorGrid.java.

57  {
58  for(final VendorProspect vp : saleProspect.getVendorProspects()) {
59  final Row row = new Row();
60  row.setValue(vp);
61  rows.appendChild(row);
62 
63  Vbox vbox = new Vbox();
64  row.appendChild(vbox);
65 
66  if(editable) {
67  Hbox hbox = new Hbox();
68  vbox.appendChild(hbox);
69 
70  final VendorCombobox vendor = new VendorCombobox();
71  vendor.setObjectValue(vp.getVendor());
72  vendor.addEventListener(Events.ON_CHANGE, new EventListener() {
73  @Override
74  public void onEvent(Event event) throws Exception {
75  vp.setVendor(vendor.getObjectValue());
76  vp.setProspectDate(new Date());
77  }
78  });
79  hbox.appendChild(vendor);
80 
81  final Image img = new Image("/_zul/images/delete.png");
82  img.setStyle("cursor:pointer");
83  img.addEventListener(Events.ON_CLICK, new EventListener() {
84  @Override
85  public void onEvent(Event event) throws Exception {
86  Messages.confirmDeletion().show(() -> {
87  saleProspect.getVendorProspects().remove(vp);
88  setSaleProspect(saleProspect);
89  });
90  }
91  });
92  hbox.appendChild(img);
93 
94  final FormulaListbox comission = new FormulaListbox();
95  comission.setFormulaType(FormulaType.FORMULA_COMISSION);
96  comission.setObjectValue(vp.getComission());
97  comission.addEventListener(Events.ON_SELECT, new EventListener() {
98  @Override
99  public void onEvent(Event event) throws Exception {
100  vp.setComission(comission.getObjectValue());
101  }
102  });
103  vbox.appendChild(comission);
104  comission.afterCompose();
105 
106  final FormulaListbox alert = new FormulaListbox();
107  alert.setFormulaType(FormulaType.FORMULA_ALERT);
108  alert.setObjectValue(vp.getAlert());
109  alert.addEventListener(Events.ON_SELECT, new EventListener() {
110  @Override
111  public void onEvent(Event event) throws Exception {
112  vp.setAlert(alert.getObjectValue());
113  }
114  });
115  vbox.appendChild(alert);
116  alert.afterCompose();
117 
118  } else {
119  Label label = new Label(vp.getVendor() != null ? vp.getVendor().getName() : "***");
120  vbox.appendChild(label);
121 
122  label = new Label(vp.getComission().getName());
123  vbox.appendChild(label);
124 
125  label = new Label(vp.getAlert().getName());
126  vbox.appendChild(label);
127  }
128  }
129  }
Set< VendorProspect > getVendorProspects()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setAddToolbar()

void org.turro.crm.zul.sale.SaleProspectVendorGrid.setAddToolbar ( boolean  addToolbar)

Definition at line 49 of file SaleProspectVendorGrid.java.

49  {
50  if(addToolbar) {
51  toolbar = new Toolbar();
52  getParent().appendChild(toolbar);
53  addToolbarButtons();
54  }
55  }

◆ setEditable()

void org.turro.crm.zul.sale.SaleProspectVendorGrid.setEditable ( boolean  editable)

Definition at line 33 of file SaleProspectVendorGrid.java.

33  {
34  this.editable = editable;
35  if(saleProspect != null) {
36  setSaleProspect(saleProspect);
37  }
38  updateButtons();
39  }
Here is the call graph for this function:

◆ setSaleProspect()

void org.turro.crm.zul.sale.SaleProspectVendorGrid.setSaleProspect ( SaleProspect  saleProspect)

Definition at line 41 of file SaleProspectVendorGrid.java.

41  {
42  this.saleProspect = saleProspect;
43  rows.getChildren().clear();
44  if(saleProspect != null) {
45  addRows();
46  }
47  }
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: