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

Public Member Functions

 ConnectorGridOld ()
 
void setContact (Contact contact)
 
void setAddToolbar (boolean addToolbar)
 
void addRows ()
 

Detailed Description

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

Definition at line 43 of file ConnectorGridOld.java.

Constructor & Destructor Documentation

◆ ConnectorGridOld()

org.turro.contacts.zul.contact.ConnectorGridOld.ConnectorGridOld ( )

Definition at line 50 of file ConnectorGridOld.java.

50  {
51  rows = new Rows();
52  appendChild(rows);
53  }

Member Function Documentation

◆ addRows()

void org.turro.contacts.zul.contact.ConnectorGridOld.addRows ( )

Definition at line 71 of file ConnectorGridOld.java.

71  {
72  for(final Connector c : contact.getConnectors()) {
73  final Row row = new Row();
74  row.setValue(c);
75  rows.appendChild(row);
76 
77  Hbox hbox = new Hbox();
78  row.appendChild(hbox);
79 
80  final ConnectorNameCombobox name = new ConnectorNameCombobox();
81  name.setConnectorName(c.getDescription());
82  name.addEventListener(Events.ON_CHANGE, new EventListener() {
83  @Override
84  public void onEvent(Event event) throws Exception {
85  c.setDescription(name.getConnectorName());
86  }
87  });
88  hbox.appendChild(name);
89 
90  if(Application.getApplication().isInRole("contact-connector:delete")) {
91  hbox.appendChild(new Separator("vertical"));
92  Image img = new Image("/_zul/images/edit-delete.png");
93  img.setStyle("cursor:pointer");
94  img.addEventListener(Events.ON_CLICK, new EventListener() {
95  @Override
96  public void onEvent(Event event) throws Exception {
97  Messages.confirmDeletion().show(() -> {
98  contact.getConnectors().remove(c);
99  c.setContact(null);
100  row.detach();
101  });
102  }
103  });
104  hbox.appendChild(img);
105  }
106 
107  final Textbox value = new Textbox();
108  value.setWidth("500px");
109  value.setText(c.getValue());
110  value.addEventListener(Events.ON_CHANGE, new EventListener() {
111  @Override
112  public void onEvent(Event event) throws Exception {
113  c.setValue(value.getText());
114  }
115  });
116  row.appendChild(value);
117 
118  }
119  }
Set< Connector > getConnectors()
Definition: Contact.java:367
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setAddToolbar()

void org.turro.contacts.zul.contact.ConnectorGridOld.setAddToolbar ( boolean  addToolbar)

Definition at line 63 of file ConnectorGridOld.java.

63  {
64  if(addToolbar) {
65  toolbar = new Toolbar();
66  getParent().appendChild(toolbar);
67  addToolbarButtons();
68  }
69  }

◆ setContact()

void org.turro.contacts.zul.contact.ConnectorGridOld.setContact ( Contact  contact)

Definition at line 55 of file ConnectorGridOld.java.

55  {
56  this.contact = contact;
57  rows.getChildren().clear();
58  if(contact != null) {
59  addRows();
60  }
61  }
Here is the call graph for this function:

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