BrightSide Workbench Full Report + Source Code
org.turro.contacts.social.SocialGroupListbox Class Reference
Inheritance diagram for org.turro.contacts.social.SocialGroupListbox:
Collaboration diagram for org.turro.contacts.social.SocialGroupListbox:

Public Member Functions

void setContact (Contact contact)
 
void loadSocialGroups (boolean multiple)
 
void setKeyString (String key)
 
String getKeyString ()
 
- Public Member Functions inherited from org.turro.zkoss.input.CollectionListbox< V >
 CollectionListbox ()
 
 CollectionListbox (Collection< V > collection)
 
void updateCollection ()
 
void updateCollection (Collection< V > collection)
 
boolean isAllowNull ()
 
void setAllowNull (boolean allowNull)
 
Collection< V > getCollection ()
 
void setCollection (Collection< V > collection)
 
boolean isNullAtBottom ()
 
void setNullAtBottom (boolean nullAtBottom)
 
String getNullLabel ()
 
void setNullLabel (String nullLabel)
 
- Public Member Functions inherited from org.turro.zkoss.input.GenericListbox< V >
 GenericListbox ()
 
void setDisabled (boolean value)
 
void afterCompose ()
 
void clearItems ()
 
void setObjectValue (V value)
 
void setObjectValues (Collection< V > collection)
 
getObjectValue ()
 
Collection< V > getObjectValues ()
 
Collection< V > getDeselectedObjectValues ()
 
boolean isSelectFirst ()
 
void setSelectFirst (boolean selectFirst)
 
Set getDeselectedItems ()
 
void sort ()
 
Object getRelatedEntity ()
 
void setRelatedEntity (Object relatedEntity)
 

Protected Member Functions

String convertToString (SocialGroupValue v)
 
- Protected Member Functions inherited from org.turro.zkoss.input.CollectionListbox< V >
void populateList ()
 
boolean equals (V value, V obj)
 
abstract String convertToString (V v)
 
void beforeAppend (Listitem li)
 

Additional Inherited Members

- Static Public Attributes inherited from org.turro.zkoss.input.CollectionListbox< V >
static final String ITEM_SEPARATOR = "|||"
 
- Protected Attributes inherited from org.turro.zkoss.input.GenericListbox< V >
boolean populated = false
 

Detailed Description

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

Definition at line 33 of file SocialGroupListbox.java.

Member Function Documentation

◆ convertToString()

String org.turro.contacts.social.SocialGroupListbox.convertToString ( SocialGroupValue  v)
protected

Definition at line 49 of file SocialGroupListbox.java.

49  {
50  return v.getName();
51  }
Here is the call graph for this function:

◆ getKeyString()

String org.turro.contacts.social.SocialGroupListbox.getKeyString ( )

Definition at line 73 of file SocialGroupListbox.java.

73  {
74  SocialGroupValue sgm = getObjectValue();
75  return sgm == null ? null : sgm.getKey();
76  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadSocialGroups()

void org.turro.contacts.social.SocialGroupListbox.loadSocialGroups ( boolean  multiple)

Definition at line 53 of file SocialGroupListbox.java.

53  {
54  setSelectFirst(false);
55  if(multiple) {
56  setMultiple(true);
57  setCheckmark(true);
58  }
59  TreeSet<SocialGroupValue> set = new TreeSet<>();
60  SocialGroups.allowedSocialGroups().forEach(sg -> {
61  set.add(new SocialGroupValue(sg.getName(), sg.getId(), sg.getType()));
62  });
63  updateCollection(set);
64  }
void setSelectFirst(boolean selectFirst)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setContact()

void org.turro.contacts.social.SocialGroupListbox.setContact ( Contact  contact)

Definition at line 35 of file SocialGroupListbox.java.

35  {
36  if(getCollection() == null || getCollection().isEmpty()) {
37  loadSocialGroups(true);
38  }
39  SocialGroups instance = SocialGroups.instance();
40  Set<SocialGroupValue> selected = new HashSet<>();
41  contact.getSyndications().forEach(syndication -> {
42  SecurityGroup sg = instance.getSocialGroup(syndication.getName());
43  selected.add(new SocialGroupValue(sg.getName(), sg.getId(), sg.getType()));
44  });
45  setObjectValues(selected);
46  }
void setObjectValues(Collection< V > collection)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setKeyString()

void org.turro.contacts.social.SocialGroupListbox.setKeyString ( String  key)

Definition at line 66 of file SocialGroupListbox.java.

66  {
67  if(getCollection() == null || getCollection().isEmpty()) {
68  loadSocialGroups(false);
69  }
70  setObjectValue(getCollection().stream().filter(sgv -> sgv.getKey().equals(key)).findFirst().orElse(null));
71  }
Here is the call graph for this function:

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