BrightSide Workbench Full Report + Source Code
org.turro.zkoss.input.GenericComboModel Class Referenceabstract
Inheritance diagram for org.turro.zkoss.input.GenericComboModel:
Collaboration diagram for org.turro.zkoss.input.GenericComboModel:

Public Member Functions

 GenericComboModel (Object[] data)
 
 GenericComboModel (List data)
 
Object getElementAt (int index)
 
int getSize ()
 
void sort (Comparator cmpr, boolean ascending)
 
String getSortDirection (Comparator< Object > cmpr)
 
synchronized ListModel getSubModel (Object value, int nRows)
 
abstract void populateList (String value, LinkedList list, int nRows)
 

Detailed Description

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

Definition at line 34 of file GenericComboModel.java.

Constructor & Destructor Documentation

◆ GenericComboModel() [1/2]

org.turro.zkoss.input.GenericComboModel.GenericComboModel ( Object[]  data)

Definition at line 41 of file GenericComboModel.java.

41  {
42  this.data = data;
43  }
Here is the caller graph for this function:

◆ GenericComboModel() [2/2]

org.turro.zkoss.input.GenericComboModel.GenericComboModel ( List  data)

Definition at line 45 of file GenericComboModel.java.

45  {
46  this.data = data.toArray(new Object[data.size()]);
47  }

Member Function Documentation

◆ getElementAt()

Object org.turro.zkoss.input.GenericComboModel.getElementAt ( int  index)

Definition at line 50 of file GenericComboModel.java.

50  {
51  return data != null && index >= 0 && index < data.length ? data[index] : null;
52  }

◆ getSize()

int org.turro.zkoss.input.GenericComboModel.getSize ( )

Definition at line 55 of file GenericComboModel.java.

55  {
56  return data.length;
57  }

◆ getSortDirection()

String org.turro.zkoss.input.GenericComboModel.getSortDirection ( Comparator< Object >  cmpr)

Definition at line 66 of file GenericComboModel.java.

66  {
67  return "natural";
68  }

◆ getSubModel()

synchronized ListModel org.turro.zkoss.input.GenericComboModel.getSubModel ( Object  value,
int  nRows 
)

Definition at line 71 of file GenericComboModel.java.

71  {
72  if(value != null && value.equals(lastValue)) return this;
73  lastValue = value;
74  LinkedList list = new LinkedList();
75  if(nRows < 1) nRows = 20;
76  populateList(value.toString(), list, nRows);
77  return new GenericComboModel(list) {
78  @Override
79  public void populateList(String value, LinkedList list, int nRows) {
80  throw new UnsupportedOperationException("Submodel does not populate items");
81  }
82  };
83  }
abstract void populateList(String value, LinkedList list, int nRows)
Here is the call graph for this function:

◆ populateList()

abstract void org.turro.zkoss.input.GenericComboModel.populateList ( String  value,
LinkedList  list,
int  nRows 
)
abstract
Here is the caller graph for this function:

◆ sort()

void org.turro.zkoss.input.GenericComboModel.sort ( Comparator  cmpr,
boolean  ascending 
)

Definition at line 60 of file GenericComboModel.java.

60  {
61  Arrays.sort(data, cmpr);
62  fireEvent(ListDataEvent.CONTENTS_CHANGED, -1, -1);
63  }

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