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

Public Member Functions

 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

boolean equals (V value, V obj)
 
abstract void populateList ()
 

Protected Attributes

boolean populated = false
 

Detailed Description

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

Definition at line 34 of file GenericListbox.java.

Constructor & Destructor Documentation

◆ GenericListbox()

Definition at line 41 of file GenericListbox.java.

41  {
42  }

Member Function Documentation

◆ afterCompose()

void org.turro.zkoss.input.GenericListbox< V >.afterCompose ( )

Reimplemented in org.turro.newsletter.TemplatesMailListbox, org.turro.crm.zul.sale.SaleProspectListbox, org.turro.crm.zul.customer.CustomerListbox, org.turro.calendar.ScheduleListbox, org.turro.financials.document.DocumentListbox, org.turro.financials.document.DocumentLinesListbox, org.turro.financials.contract.ContractPreferencesListbox, org.turro.erp.sales.PendingCustomerOrderListbox, org.turro.erp.resource.RequiredAptitudeListbox, and org.turro.erp.humanres.AptitudeListbox.

Definition at line 53 of file GenericListbox.java.

53  {
54  if(!populated) {
55  populateList();
56  populated = true;
57  if(internalValue != null) {
58  setObjectValue(internalValue);
59  internalValue = null;
60  } else if (internalValues != null) {
61  setObjectValues(internalValues);
62  internalValues = null;
63  } else {
64  setObjectValue(null);
65  }
66  }
67  }
void setObjectValues(Collection< V > collection)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ clearItems()

void org.turro.zkoss.input.GenericListbox< V >.clearItems ( )

Definition at line 69 of file GenericListbox.java.

69  {
70  getItems().clear();
71  populated = false;
72  }
Here is the caller graph for this function:

◆ equals()

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

Reimplemented in org.turro.zkoss.input.CollectionListbox< V >, and org.turro.jpa.input.JpaListbox< V >.

Definition at line 168 of file GenericListbox.java.

168  {
169  return (value == null && obj == null) ||
170  (value != null && value.equals(obj));
171  }
Here is the caller graph for this function:

◆ getDeselectedItems()

Set org.turro.zkoss.input.GenericListbox< V >.getDeselectedItems ( )

Definition at line 137 of file GenericListbox.java.

137  {
138  Set set = new HashSet();
139  for(Listitem li : (List<Listitem>) getItems()) {
140  if(!li.isSelected()) {
141  set.add(li);
142  }
143  }
144  return set;
145  }
Here is the caller graph for this function:

◆ getDeselectedObjectValues()

Collection<V> org.turro.zkoss.input.GenericListbox< V >.getDeselectedObjectValues ( )

Definition at line 122 of file GenericListbox.java.

122  {
123  if(!populated) {
124  return internalValues;
125  }
126  return new ListitemValueAdapter<V>(getDeselectedItems(), false);
127  }
Here is the call graph for this function:

◆ getObjectValue()

V org.turro.zkoss.input.GenericListbox< V >.getObjectValue ( )

Reimplemented in org.turro.erp.task.TaskListbox, org.turro.erp.reference.ProductReferenceListbox, and org.turro.erp.reference.OrderReferencePositionListbox.

Definition at line 104 of file GenericListbox.java.

104  {
105  if(!populated) {
106  return internalValue;
107  }
108  Listitem li = getSelectedItem();
109  if(li != null) {
110  return (V) li.getValue();
111  }
112  return null;
113  }
Here is the caller graph for this function:

◆ getObjectValues()

Collection<V> org.turro.zkoss.input.GenericListbox< V >.getObjectValues ( )

Definition at line 115 of file GenericListbox.java.

115  {
116  if(!populated) {
117  return internalValues;
118  }
119  return new ListitemValueAdapter<V>(getSelectedItems(), true);
120  }
Here is the caller graph for this function:

◆ getRelatedEntity()

Object org.turro.zkoss.input.GenericListbox< V >.getRelatedEntity ( )

Definition at line 179 of file GenericListbox.java.

179  {
180  return relatedEntity;
181  }

◆ isSelectFirst()

boolean org.turro.zkoss.input.GenericListbox< V >.isSelectFirst ( )

Definition at line 129 of file GenericListbox.java.

129  {
130  return selectFirst;
131  }

◆ populateList()

◆ setDisabled()

void org.turro.zkoss.input.GenericListbox< V >.setDisabled ( boolean  value)

Definition at line 45 of file GenericListbox.java.

45  {
46  super.setDisabled(value);
47  for(Listitem li : getItems()) {
48  li.setDisabled(value);
49  }
50  }
Here is the caller graph for this function:

◆ setObjectValue()

void org.turro.zkoss.input.GenericListbox< V >.setObjectValue ( value)

Definition at line 74 of file GenericListbox.java.

74  {
75  if(!populated) {
76  internalValue = value;
77  }
78  if(value == null && selectFirst && getItemCount() > 0) {
79  setSelectedIndex(0);
80  } else {
81  for(Object item : getItems()) {
82  if(item instanceof Listitem) {
83  if(equals((V) ((Listitem) item).getValue(), (V) value)) {
84  setSelectedItem((Listitem) item);
85  }
86  }
87  }
88  }
89  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setObjectValues()

void org.turro.zkoss.input.GenericListbox< V >.setObjectValues ( Collection< V >  collection)

Definition at line 91 of file GenericListbox.java.

91  {
92  if(!populated) {
93  internalValues = collection;
94  }
95  setSelectedItem(null);
96  setSelectedItems(new ValueListitemAdapter<V>(this, collection) {
97  @Override
98  protected boolean equals(V value, V obj) {
99  return GenericListbox.this.equals(value, obj);
100  }
101  });
102  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setRelatedEntity()

void org.turro.zkoss.input.GenericListbox< V >.setRelatedEntity ( Object  relatedEntity)

Definition at line 183 of file GenericListbox.java.

183  {
184  this.relatedEntity = relatedEntity;
185  }

◆ setSelectFirst()

void org.turro.zkoss.input.GenericListbox< V >.setSelectFirst ( boolean  selectFirst)

Definition at line 133 of file GenericListbox.java.

133  {
134  this.selectFirst = selectFirst;
135  }
Here is the caller graph for this function:

◆ sort()

Definition at line 147 of file GenericListbox.java.

147  {
148  Collection c = getHeads();
149  if(c == null || c.isEmpty()) {
150  Listhead lh = new Listhead();
151  Listheader lhr = new Listheader();
152  lhr.setSort("auto");
153  lh.appendChild(lhr);
154  appendChild(lh);
155  c = getHeads();
156  lh.setVisible(false);
157  }
158  for(Object h : c) {
159  if(h instanceof Listhead) {
160  if(((Listhead) h).getFirstChild() instanceof Listheader) {
161  ((Listheader) ((Listhead) h).getFirstChild()).sort(true);
162  break;
163  }
164  }
165  }
166  }
Here is the caller graph for this function:

Member Data Documentation

◆ populated

boolean org.turro.zkoss.input.GenericListbox< V >.populated = false
protected

Definition at line 39 of file GenericListbox.java.


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