◆ ContactComboModel() [1/2]
org.turro.contacts.util.ContactComboModel.ContactComboModel |
( |
Object[] |
data, |
|
|
String |
roleIn |
|
) |
| |
◆ ContactComboModel() [2/2]
org.turro.contacts.util.ContactComboModel.ContactComboModel |
( |
List |
data, |
|
|
String |
roleIn |
|
) |
| |
Definition at line 57 of file ContactComboModel.java.
58 this.data = data.toArray(
new Object[data.size()]);
60 onlyUsers = !Strings.isEmpty(roleIn);
◆ getElementAt()
Object org.turro.contacts.util.ContactComboModel.getElementAt |
( |
int |
index | ) |
|
◆ getSize()
int org.turro.contacts.util.ContactComboModel.getSize |
( |
| ) |
|
◆ getSortDirection()
String org.turro.contacts.util.ContactComboModel.getSortDirection |
( |
Comparator< Contact > |
cmpr | ) |
|
◆ getSubModel()
ListModel org.turro.contacts.util.ContactComboModel.getSubModel |
( |
Object |
value, |
|
|
int |
nRows |
|
) |
| |
Definition at line 86 of file ContactComboModel.java.
87 if(value !=
null && value.equals(lastValue))
return this;
89 LinkedList lData =
new LinkedList();
90 Dao dao =
new ContactsPU();
91 WhereClause wc =
new WhereClause();
92 wc.addClause(
"select contact from Contact as contact");
93 wc.addClause(
"where 1=1");
95 wc.addClause(
"and contact.login is not null");
100 wc.addLikeFields(
new String[]{
"contact.name" }, value.toString());
101 wc.addClause(
"order by contact.name");
102 if(nRows < 1) nRows = 10;
103 for(Object o : dao.getResultList(wc, nRows)) {
104 Contact c = (Contact) o;
105 if(!onlyUsers || (onlyUsers && c.isWebUser())) {
106 lData.add(c.getName());
◆ isOnlyUsers()
boolean org.turro.contacts.util.ContactComboModel.isOnlyUsers |
( |
| ) |
|
◆ setOnlyUsers()
void org.turro.contacts.util.ContactComboModel.setOnlyUsers |
( |
boolean |
onlyUsers | ) |
|
◆ sort()
void org.turro.contacts.util.ContactComboModel.sort |
( |
Comparator |
cmpr, |
|
|
boolean |
ascending |
|
) |
| |
Definition at line 75 of file ContactComboModel.java.
76 Arrays.sort(data, cmpr);
77 fireEvent(ListDataEvent.CONTENTS_CHANGED, -1, -1);
The documentation for this class was generated from the following file: