BrightSide Workbench Full Report + Source Code
org.turro.attach.zul.FolderNameComboModel Class Reference
Inheritance diagram for org.turro.attach.zul.FolderNameComboModel:
Collaboration diagram for org.turro.attach.zul.FolderNameComboModel:

Public Member Functions

 FolderNameComboModel (Object[] data, IAttachFolder parentFolder)
 
 FolderNameComboModel (List data, IAttachFolder parentFolder)
 
Object getElementAt (int index)
 
int getSize ()
 
void sort (Comparator cmpr, boolean ascending)
 
String getSortDirection (Comparator cmpr)
 
ListModel getSubModel (Object value, int nRows)
 

Detailed Description

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

Definition at line 38 of file FolderNameComboModel.java.

Constructor & Destructor Documentation

◆ FolderNameComboModel() [1/2]

org.turro.attach.zul.FolderNameComboModel.FolderNameComboModel ( Object[]  data,
IAttachFolder  parentFolder 
)

Definition at line 45 of file FolderNameComboModel.java.

45  {
46  this.data = data;
47  this.parentFolder = parentFolder;
48  }
Here is the caller graph for this function:

◆ FolderNameComboModel() [2/2]

org.turro.attach.zul.FolderNameComboModel.FolderNameComboModel ( List  data,
IAttachFolder  parentFolder 
)

Definition at line 50 of file FolderNameComboModel.java.

50  {
51  this.data = data.toArray(new Object[data.size()]);
52  this.parentFolder = parentFolder;
53  }

Member Function Documentation

◆ getElementAt()

Object org.turro.attach.zul.FolderNameComboModel.getElementAt ( int  index)

Definition at line 56 of file FolderNameComboModel.java.

56  {
57  if(data == null || data.length <= index) return null;
58  return data[index];
59  }

◆ getSize()

int org.turro.attach.zul.FolderNameComboModel.getSize ( )

Definition at line 62 of file FolderNameComboModel.java.

62  {
63  return data.length;
64  }

◆ getSortDirection()

String org.turro.attach.zul.FolderNameComboModel.getSortDirection ( Comparator  cmpr)

Definition at line 73 of file FolderNameComboModel.java.

73  {
74  return "natural";
75  }

◆ getSubModel()

ListModel org.turro.attach.zul.FolderNameComboModel.getSubModel ( Object  value,
int  nRows 
)

Definition at line 78 of file FolderNameComboModel.java.

78  {
79  Dao dao = new AttachPU();
80  WhereClause wc = new WhereClause();
81  wc.addClause("select distinct attachment.path from Attachment as attachment");
82  wc.addClause("where path like :path");
83  wc.addClause("order by attachment.path");
84  wc.addNamedValue("path", rootName());
85  if(nRows < 1) nRows = 10;
86  return new FolderNameComboModel(cookList(dao.getResultList(wc, nRows), (String)value), parentFolder);
87  }
FolderNameComboModel(Object[] data, IAttachFolder parentFolder)
Here is the call graph for this function:

◆ sort()

void org.turro.attach.zul.FolderNameComboModel.sort ( Comparator  cmpr,
boolean  ascending 
)

Definition at line 67 of file FolderNameComboModel.java.

67  {
68  Arrays.sort(data, cmpr);
69  fireEvent(ListDataEvent.CONTENTS_CHANGED, -1, -1);
70  }

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