BrightSide Workbench Full Report + Source Code
org.turro.zkoss.input.CollectionListbox< V > Class Template Referenceabstract
Inheritance diagram for org.turro.zkoss.input.CollectionListbox< V >:
Collaboration diagram for org.turro.zkoss.input.CollectionListbox< V >:

Public Member Functions

 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)
 

Static Public Attributes

static final String ITEM_SEPARATOR = "|||"
 

Protected Member Functions

void populateList ()
 
boolean equals (V value, V obj)
 
abstract String convertToString (V v)
 
void beforeAppend (Listitem li)
 

Additional Inherited Members

- 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
Parameters
<V>

Definition at line 32 of file CollectionListbox.java.

Constructor & Destructor Documentation

◆ CollectionListbox() [1/2]

Definition at line 43 of file CollectionListbox.java.

43  {
44  }

◆ CollectionListbox() [2/2]

org.turro.zkoss.input.CollectionListbox< V >.CollectionListbox ( Collection< V >  collection)

Definition at line 46 of file CollectionListbox.java.

46  {
47  this.collection = collection;
48  }

Member Function Documentation

◆ beforeAppend()

void org.turro.zkoss.input.CollectionListbox< V >.beforeAppend ( Listitem  li)
protected

Reimplemented in org.turro.calendar.ScheduleListbox, and org.turro.contacts.zul.organigram.OrganigramListbox.

Definition at line 156 of file CollectionListbox.java.

156 { /* do nothing */ }
Here is the caller graph for this function:

◆ convertToString()

abstract String org.turro.zkoss.input.CollectionListbox< V >.convertToString ( v)
abstractprotected
Here is the caller graph for this function:

◆ equals()

boolean org.turro.zkoss.input.CollectionListbox< V >.equals ( value,
obj 
)
protected

Reimplemented from org.turro.zkoss.input.GenericListbox< V >.

Definition at line 147 of file CollectionListbox.java.

147  {
148  String v1 = value == null ? null : convertToString(value);
149  String v2 = obj == null ? null : convertToString(obj);
150  return (v1 == null && v2 == null) ||
151  (v1 != null && v1.equals(v2));
152  }
Here is the call graph for this function:

◆ getCollection()

Collection<V> org.turro.zkoss.input.CollectionListbox< V >.getCollection ( )

Definition at line 70 of file CollectionListbox.java.

70  {
71  return collection;
72  }
Here is the caller graph for this function:

◆ getNullLabel()

String org.turro.zkoss.input.CollectionListbox< V >.getNullLabel ( )

Definition at line 86 of file CollectionListbox.java.

86  {
87  return nullLabel;
88  }

◆ isAllowNull()

boolean org.turro.zkoss.input.CollectionListbox< V >.isAllowNull ( )

Definition at line 62 of file CollectionListbox.java.

62  {
63  return allowNull;
64  }

◆ isNullAtBottom()

boolean org.turro.zkoss.input.CollectionListbox< V >.isNullAtBottom ( )

Definition at line 78 of file CollectionListbox.java.

78  {
79  return nullAtBottom;
80  }

◆ populateList()

void org.turro.zkoss.input.CollectionListbox< V >.populateList ( )
protected

Reimplemented from org.turro.zkoss.input.GenericListbox< V >.

Reimplemented in org.turro.financials.document.DocumentListbox, and org.turro.financials.document.DocumentLinesListbox.

Definition at line 95 of file CollectionListbox.java.

95  {
96  //setSizedByContent(true);
97  clearItems();
98  if(collection == null) return;
99  if(allowNull && !nullAtBottom) {
100  Listitem li = new Listitem("<" + I_.get(nullLabel) + ">", null);
101  beforeAppend(li);
102  appendChild(li);
103  }
104  int cells = 1;
105  if(getListhead() != null && !getListhead().getChildren().isEmpty()) {
106  cells = getListhead().getChildren().size();
107  }
108  for(V v : collection) {
109  if(cells > 1) {
110  String sa[] = convertToString(v).split(ITEM_SEPARATOR_REGEX);
111  Listitem li = new Listitem();
112  li.setValue(v);
113  for(String s : sa) {
114  String ssa[] = s.split(SUBITEM_SEPARATOR_REGEX);
115  if(ssa.length > 1) {
116  Listcell cell = new Listcell(ssa[0]);
117  li.appendChild(cell);
118  Vlayout vbox = new Vlayout();
119  vbox.setStyle("padding:2px");
120  for(int i = 1; i < ssa.length; i++) {
121  vbox.appendChild(LabelTypes.getSoftLabel(ssa[i]));
122  }
123  cell.appendChild(vbox);
124  } else {
125  if(s != null && s.endsWith(SUBITEM_SEPARATOR)) {
126  s = s.replaceAll(SUBITEM_SEPARATOR_REGEX, "");
127  }
128  li.appendChild(new Listcell(s));
129  }
130  }
131  beforeAppend(li);
132  appendChild(li);
133  } else {
134  Listitem li = new Listitem(convertToString(v), v);
135  beforeAppend(li);
136  appendChild(li);
137  }
138  }
139  if(allowNull && nullAtBottom) {
140  Listitem li = new Listitem("<" + I_.get(nullLabel) + ">", null);
141  beforeAppend(li);
142  appendChild(li);
143  }
144  }
Here is the call graph for this function:

◆ setAllowNull()

void org.turro.zkoss.input.CollectionListbox< V >.setAllowNull ( boolean  allowNull)

Definition at line 66 of file CollectionListbox.java.

66  {
67  this.allowNull = allowNull;
68  }
Here is the caller graph for this function:

◆ setCollection()

void org.turro.zkoss.input.CollectionListbox< V >.setCollection ( Collection< V >  collection)

Definition at line 74 of file CollectionListbox.java.

74  {
75  this.collection = collection;
76  }
Here is the caller graph for this function:

◆ setNullAtBottom()

void org.turro.zkoss.input.CollectionListbox< V >.setNullAtBottom ( boolean  nullAtBottom)

Definition at line 82 of file CollectionListbox.java.

82  {
83  this.nullAtBottom = nullAtBottom;
84  }
Here is the caller graph for this function:

◆ setNullLabel()

void org.turro.zkoss.input.CollectionListbox< V >.setNullLabel ( String  nullLabel)

Definition at line 90 of file CollectionListbox.java.

90  {
91  this.nullLabel = nullLabel;
92  }
Here is the caller graph for this function:

◆ updateCollection() [1/2]

void org.turro.zkoss.input.CollectionListbox< V >.updateCollection ( )

Definition at line 50 of file CollectionListbox.java.

50  {
51  clearItems();
52  setCollection(collection);
53  afterCompose();
54  }
void setCollection(Collection< V > collection)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateCollection() [2/2]

void org.turro.zkoss.input.CollectionListbox< V >.updateCollection ( Collection< V >  collection)

Definition at line 56 of file CollectionListbox.java.

56  {
57  clearItems();
58  setCollection(collection);
59  afterCompose();
60  }
Here is the call graph for this function:

Member Data Documentation

◆ ITEM_SEPARATOR

final String org.turro.zkoss.input.CollectionListbox< V >.ITEM_SEPARATOR = "|||"
static

Definition at line 34 of file CollectionListbox.java.


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