BrightSide Workbench Full Report + Source Code
org.turro.contacts.model.ContactItem Class Reference

Public Member Functions

 ContactItem (Dao dao, String contactId, boolean open)
 
boolean isOpen ()
 
String getContactId ()
 
Contact getContact ()
 
String getName ()
 
List< String > getImages ()
 
String getStyle ()
 
boolean isSelected ()
 
void setSelected (boolean selected)
 
String getLocale ()
 
List< IContactRelationgetRelations ()
 

Detailed Description

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

Definition at line 37 of file ContactItem.java.

Constructor & Destructor Documentation

◆ ContactItem()

org.turro.contacts.model.ContactItem.ContactItem ( Dao  dao,
String  contactId,
boolean  open 
)

Definition at line 46 of file ContactItem.java.

46  {
47  this.dao = dao;
48  this.contactId = contactId;
49  this.open = open;
50  }

Member Function Documentation

◆ getContact()

Contact org.turro.contacts.model.ContactItem.getContact ( )

Definition at line 60 of file ContactItem.java.

60  {
61  if(contact == null) {
62  contact = dao.find(Contact.class, contactId);
63  }
64  return contact;
65  }
Here is the caller graph for this function:

◆ getContactId()

String org.turro.contacts.model.ContactItem.getContactId ( )

Definition at line 56 of file ContactItem.java.

56  {
57  return contactId;
58  }
Here is the caller graph for this function:

◆ getImages()

List<String> org.turro.contacts.model.ContactItem.getImages ( )

Definition at line 74 of file ContactItem.java.

74  {
75  if(images == null) {
76  images = new ArrayList<>();
77  Profile profile = getContact().getProfile();
78  if(profile.isCompany()) images.add(DirectoryType.DIRECTORY_COMPANIES.getImage());
79  if(profile.isCenter()) images.add(DirectoryType.DIRECTORY_CENTERS.getImage());
80  if(profile.isWorker()) images.add(DirectoryType.DIRECTORY_PROFESSIONALS.getImage());
81  if(profile.isResponsible()) images.add(DirectoryType.DIRECTORY_EDUCATORS.getImage());
82  if(profile.isStudent()) images.add(DirectoryType.DIRECTORY_STUDENTS.getImage());
83  if(getContact().isDeactivated()) images.add("cancel");
84  }
85  return images;
86  }
Here is the call graph for this function:

◆ getLocale()

String org.turro.contacts.model.ContactItem.getLocale ( )

Definition at line 100 of file ContactItem.java.

100  {
101  return getContact().getLocaleString(Application.getUsedLocale());
102  }
String getLocaleString(Locale currLocale)
Definition: Contact.java:590
Here is the call graph for this function:

◆ getName()

String org.turro.contacts.model.ContactItem.getName ( )

Definition at line 67 of file ContactItem.java.

67  {
68  String name = getContact().getFullName();
69  name += " [" + I_.byKey(getContact().getType().toString()) +
70  (!Strings.isBlank(getContact().getGrouping()) ? " - " + getContact().getGrouping() : "") + "]";
71  return name;
72  }
Here is the call graph for this function:

◆ getRelations()

List<IContactRelation> org.turro.contacts.model.ContactItem.getRelations ( )

Definition at line 104 of file ContactItem.java.

104  {
105  return ContactRelations.getRelations(contact.getId(), ContactRelations.MODE_ALL);
106  }
Here is the call graph for this function:

◆ getStyle()

String org.turro.contacts.model.ContactItem.getStyle ( )

Definition at line 88 of file ContactItem.java.

88  {
89  return getContact().isInactive() ? "font-style:oblique" : "";
90  }
Here is the call graph for this function:

◆ isOpen()

boolean org.turro.contacts.model.ContactItem.isOpen ( )

Definition at line 52 of file ContactItem.java.

52  {
53  return open;
54  }

◆ isSelected()

boolean org.turro.contacts.model.ContactItem.isSelected ( )

Definition at line 92 of file ContactItem.java.

92  {
93  return selected;
94  }

◆ setSelected()

void org.turro.contacts.model.ContactItem.setSelected ( boolean  selected)

Definition at line 96 of file ContactItem.java.

96  {
97  this.selected = selected;
98  }

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