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

Public Member Functions

 ContactInfo (Contact contact)
 
 ContactInfo (Contact contact, String icon)
 
 ContactInfo (String contactId)
 
 ContactInfo (String contactId, String icon)
 
 ContactInfo ()
 
ContactInfo setInfoStyle (String style)
 
Contact getContact ()
 
final void setContact (Contact contact)
 
final void setIContact (IContact icontact)
 
boolean isOnlyIcon ()
 
void setOnlyIcon (boolean onlyIcon)
 
final void initInfo ()
 

Static Public Member Functions

static Popup getContactPopup (Contact contact)
 

Detailed Description

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

Definition at line 44 of file ContactInfo.java.

Constructor & Destructor Documentation

◆ ContactInfo() [1/5]

org.turro.contacts.zul.label.ContactInfo.ContactInfo ( Contact  contact)

Definition at line 50 of file ContactInfo.java.

50  {
51  setContact(contact);
52  initInfo();
53  }
final void setContact(Contact contact)
Here is the call graph for this function:

◆ ContactInfo() [2/5]

org.turro.contacts.zul.label.ContactInfo.ContactInfo ( Contact  contact,
String  icon 
)

Definition at line 55 of file ContactInfo.java.

55  {
56  this.icon = icon;
57  setContact(contact);
58  initInfo();
59  }
Here is the call graph for this function:

◆ ContactInfo() [3/5]

org.turro.contacts.zul.label.ContactInfo.ContactInfo ( String  contactId)

Definition at line 61 of file ContactInfo.java.

61  {
62  this(contactId, null);
63  }

◆ ContactInfo() [4/5]

org.turro.contacts.zul.label.ContactInfo.ContactInfo ( String  contactId,
String  icon 
)

Definition at line 65 of file ContactInfo.java.

65  {
66  this.icon = icon;
67  //TODO: make it run faster
68  IContact ic = Contacts.getContactById(contactId);
69  if(ic != null && ic.isValid()) {
70  contact = (Contact) ic.getContact();
71  }
72  initInfo();
73  }
static IContact getContactById(String id)
Definition: Contacts.java:72
Here is the call graph for this function:

◆ ContactInfo() [5/5]

org.turro.contacts.zul.label.ContactInfo.ContactInfo ( )

Definition at line 75 of file ContactInfo.java.

75  {
76  }

Member Function Documentation

◆ getContact()

Contact org.turro.contacts.zul.label.ContactInfo.getContact ( )

Definition at line 83 of file ContactInfo.java.

83  {
84  return contact;
85  }

◆ getContactPopup()

static Popup org.turro.contacts.zul.label.ContactInfo.getContactPopup ( Contact  contact)
static

Definition at line 127 of file ContactInfo.java.

127  {
128  Application app = Application.getApplication();
129  Popup popup = Framework.getCurrent().getGlobalPopup();
130 
131  if(popup == null) return null;
132 
133  Hlayout backlayout = new Hlayout();
134  backlayout.setSpacing("10px");
135  popup.appendChild(backlayout);
136 
137  FileAttach fileAttach = new FileAttach(ContactsPU.getObjectPath(contact));
138  String face = fileAttach.getPublicFile("/profile/face.png", false);
139 
140  if(!org.zkoss.lang.Strings.isBlank(face)) {
141  backlayout.appendChild(new ImageWrapper(face, 50, 50));
142  }
143 
144  Vlayout vbox = new Vlayout();
145  vbox.setHflex("1");
146  vbox.setStyle("font-size:11px");
147  backlayout.appendChild(vbox);
148 
149  String name = contact.getName();
150  name += " [" + I_.byKey(contact.getType().toString()) +
151  (!Strings.isBlank(contact.getGrouping()) ? " - " + contact.getGrouping() : "") + "]";
152  vbox.appendChild(LabelTypes.getCaptionLabel(name));
153 
154  if(!Strings.isEmpty(contact.getGlobalIdentifier())) {
155  vbox.appendChild(LabelTypes.getSoftLabel(I_.get("Global identifier") + ": " + contact.getGlobalIdentifier()));
156  }
157 
158  if(app.isInRole("contact-tag:list")) {
159  String tags = contact.getTagsString();
160  if(!Strings.isEmpty(tags)) {
161  vbox.appendChild(LabelTypes.getTinyLabel(I_.get("Tags") + " " + tags));
162  }
163  }
164 
165  if(app.isInRole("contact-address:list")) {
166  for(Address address : contact.getAddresses()) {
167  vbox.appendChild(LabelTypes.getSoftLabel(address.getFullAddress()));
168  }
169  }
170 
171  if(app.isInRole("contact-connector:list")) {
172  for(Connector connector : contact.getConnectors()) {
173  vbox.appendChild(LabelTypes.getSoftLabel(connector.getFullConnector()));
174  }
175  }
176 
177  if(app.isInRole("contact-value:list")) {
178  for(FieldValue fv : contact.getFieldValues()) {
179  vbox.appendChild(getFieldLine(fv));
180  }
181  }
182 
183  if(app.isInRole("contact-relation:list")) {
184  RelationLayout rl = new RelationLayout(contact);
185  rl.fillContactInfo();
186  if(rl.hasContent()) {
187  vbox.appendChild(rl);
188  }
189  }
190  if(!vbox.getChildren().isEmpty()) {
191  return popup;
192  } else {
193  return null;
194  }
195  }
Set< FieldValue > getFieldValues()
Definition: Contact.java:427
Set< Address > getAddresses()
Definition: Contact.java:355
Set< Connector > getConnectors()
Definition: Contact.java:367
static String getObjectPath(Object object)
Definition: ContactsPU.java:68
String getPublicFile(String file)
Definition: FileAttach.java:59
static String byKey(String key)
Definition: I_.java:83
static String get(String msg)
Definition: I_.java:41
Here is the call graph for this function:

◆ initInfo()

final void org.turro.contacts.zul.label.ContactInfo.initInfo ( )

Definition at line 105 of file ContactInfo.java.

105  {
106  updateLabel();
107  addClickListener();
108  }
Here is the caller graph for this function:

◆ isOnlyIcon()

boolean org.turro.contacts.zul.label.ContactInfo.isOnlyIcon ( )

Definition at line 96 of file ContactInfo.java.

96  {
97  return onlyIcon;
98  }

◆ setContact()

final void org.turro.contacts.zul.label.ContactInfo.setContact ( Contact  contact)

Definition at line 87 of file ContactInfo.java.

87  {
88  this.contact = contact;
89  updateLabel();
90  }
Here is the caller graph for this function:

◆ setIContact()

final void org.turro.contacts.zul.label.ContactInfo.setIContact ( IContact  icontact)

Definition at line 92 of file ContactInfo.java.

92  {
93  setContact(icontact == null ? null : (Contact) icontact.getContact());
94  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setInfoStyle()

ContactInfo org.turro.contacts.zul.label.ContactInfo.setInfoStyle ( String  style)

Definition at line 78 of file ContactInfo.java.

78  {
79  setStyle(style);
80  return this;
81  }

◆ setOnlyIcon()

void org.turro.contacts.zul.label.ContactInfo.setOnlyIcon ( boolean  onlyIcon)

Definition at line 100 of file ContactInfo.java.

100  {
101  this.onlyIcon = onlyIcon;
102  updateLabel();
103  }

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