BrightSide Workbench Full Report + Source Code
org.turro.zkoss.grid.PagingGrid Class Reference
Inheritance diagram for org.turro.zkoss.grid.PagingGrid:
Collaboration diagram for org.turro.zkoss.grid.PagingGrid:

Public Member Functions

void setColumns (int columns)
 
void setColumns (String hflexs)
 
void refine ()
 
boolean isDefaultBehavior ()
 
void setDefaultBehavior (boolean defaultBehavior)
 
String getRefineValue ()
 
void setRefineValue (String value)
 
int getMaxResults ()
 
void setMaxResults (int maxResults)
 
String getPagingMold ()
 
void setPagingMold (String pagingMold)
 
int getRowCount ()
 
void setRowCount (int rows)
 
void setHeadersVisible (boolean value)
 
boolean isHeadersVisible ()
 
String getVarColumns ()
 
void setVarColumns (String varColumns)
 
Collection< String > getVarColumnsList (String defaultCols)
 
void addDetailColumn ()
 
void addDetailColumn (HtmlBasedComponent caption)
 
void openDetails ()
 
boolean isEmpty ()
 
void clearColumns ()
 
void clearRows ()
 
void clearEmptyGroups ()
 
Columns getColumns (boolean create)
 
Rows getRows (boolean create)
 
Foot getFoot (boolean create)
 
Foot createFoot ()
 
void exportToPdf ()
 

Detailed Description

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

Definition at line 46 of file PagingGrid.java.

Member Function Documentation

◆ addDetailColumn() [1/2]

void org.turro.zkoss.grid.PagingGrid.addDetailColumn ( )

Definition at line 185 of file PagingGrid.java.

185  {
186  addDetailColumn(null);
187  }

◆ addDetailColumn() [2/2]

void org.turro.zkoss.grid.PagingGrid.addDetailColumn ( HtmlBasedComponent  caption)

Definition at line 189 of file PagingGrid.java.

189  {
190  Column c = new Column();
191  c.setWidth("40px");
192  if(caption != null) {
193  c.appendChild(caption);
194  }
195  getColumns(true).appendChild(c);
196  }
Columns getColumns(boolean create)
Here is the call graph for this function:

◆ clearColumns()

void org.turro.zkoss.grid.PagingGrid.clearColumns ( )

Reimplemented in org.turro.zkoss.grid.EditableGrid< V >.

Definition at line 212 of file PagingGrid.java.

212  {
213  getColumns(true).getChildren().clear();
214  }
Here is the call graph for this function:

◆ clearEmptyGroups()

void org.turro.zkoss.grid.PagingGrid.clearEmptyGroups ( )

Definition at line 220 of file PagingGrid.java.

220  {
221  Rows rows = getRows();
222  if(rows != null) {
223  Iterator<Component> it = (Iterator<Component>) rows.getChildren().iterator();
224  while(it.hasNext()) {
225  Row row = (Row) it.next();
226  if(row instanceof Group) {
227  Group group = (Group) row;
228  if(group.getItemCount() == 0) {
229  it.remove();
230  }
231  }
232  }
233  }
234  }
Rows getRows(boolean create)
Here is the call graph for this function:

◆ clearRows()

void org.turro.zkoss.grid.PagingGrid.clearRows ( )

Reimplemented in org.turro.zkoss.grid.EditableGrid< V >.

Definition at line 216 of file PagingGrid.java.

216  {
217  getRows(true).getChildren().clear();
218  }
Here is the call graph for this function:

◆ createFoot()

Foot org.turro.zkoss.grid.PagingGrid.createFoot ( )

Definition at line 265 of file PagingGrid.java.

265  {
266  Foot foot = getFoot();
267  if(foot != null) {
268  foot.detach();
269  }
270  foot = new Foot();
271  appendChild(foot);
272  return foot;
273  }
Foot getFoot(boolean create)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exportToPdf()

void org.turro.zkoss.grid.PagingGrid.exportToPdf ( )

Definition at line 275 of file PagingGrid.java.

275  {
276  try {
277  ByteArrayOutputStream out = new ByteArrayOutputStream();
278  PdfExporter exporter = new PdfExporter();
279  exporter.export(this, out);
280  AMedia amedia = new AMedia("GridReport.pdf", "pdf", "application/pdf", out.toByteArray());
281  Filedownload.save(amedia);
282  out.close();
283  } catch (Exception ex) {
284  Logger.getLogger(PagingGrid.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
285  }
286  }
Here is the call graph for this function:

◆ getColumns()

Columns org.turro.zkoss.grid.PagingGrid.getColumns ( boolean  create)

Definition at line 236 of file PagingGrid.java.

236  {
237  Columns cols = super.getColumns();
238  if(create && cols == null) {
239  cols = new Columns();
240  cols.setSizable(true);
241  appendChild(cols);
242  }
243  return cols;
244  }
Here is the caller graph for this function:

◆ getFoot()

Foot org.turro.zkoss.grid.PagingGrid.getFoot ( boolean  create)

Definition at line 256 of file PagingGrid.java.

256  {
257  Foot foot = getFoot();
258  if(create && foot == null) {
259  foot = new Foot();
260  appendChild(foot);
261  }
262  return foot;
263  }
Here is the caller graph for this function:

◆ getMaxResults()

int org.turro.zkoss.grid.PagingGrid.getMaxResults ( )

Definition at line 121 of file PagingGrid.java.

121  {
122  return maxResults;
123  }

◆ getPagingMold()

String org.turro.zkoss.grid.PagingGrid.getPagingMold ( )

Definition at line 129 of file PagingGrid.java.

129  {
130  return pagingMold;
131  }

◆ getRefineValue()

String org.turro.zkoss.grid.PagingGrid.getRefineValue ( )

Definition at line 111 of file PagingGrid.java.

111  {
112  return refineValue;
113  }

◆ getRowCount()

int org.turro.zkoss.grid.PagingGrid.getRowCount ( )

Definition at line 137 of file PagingGrid.java.

137  {
138  return getRows().getChildren().size();
139  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRows()

Rows org.turro.zkoss.grid.PagingGrid.getRows ( boolean  create)

Definition at line 246 of file PagingGrid.java.

246  {
247  Rows rows = getRows();
248  if(create && rows == null) {
249  rows = new Rows();
250  appendChild(rows);
251  }
252  return rows;
253  }
Here is the caller graph for this function:

◆ getVarColumns()

String org.turro.zkoss.grid.PagingGrid.getVarColumns ( )

Definition at line 170 of file PagingGrid.java.

170  {
171  return varColumns;
172  }

◆ getVarColumnsList()

Collection<String> org.turro.zkoss.grid.PagingGrid.getVarColumnsList ( String  defaultCols)

Definition at line 178 of file PagingGrid.java.

178  {
179  return varColumns == null ?
180  (defaultCols == null ? new ArrayList<String>() :
181  Arrays.asList(defaultCols.split("\\s*\\,\\s*"))) :
182  Arrays.asList(varColumns.split("\\s*\\,\\s*"));
183  }

◆ isDefaultBehavior()

boolean org.turro.zkoss.grid.PagingGrid.isDefaultBehavior ( )

Definition at line 103 of file PagingGrid.java.

103  {
104  return defaultBehavior;
105  }

◆ isEmpty()

boolean org.turro.zkoss.grid.PagingGrid.isEmpty ( )

Definition at line 208 of file PagingGrid.java.

208  {
209  return getRows() == null || getRows().getChildren() == null;
210  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isHeadersVisible()

boolean org.turro.zkoss.grid.PagingGrid.isHeadersVisible ( )

Definition at line 166 of file PagingGrid.java.

166  {
167  return getColumns().isVisible();
168  }
Here is the call graph for this function:

◆ openDetails()

void org.turro.zkoss.grid.PagingGrid.openDetails ( )

Definition at line 198 of file PagingGrid.java.

198  {
199  for(Component row : getRows().getChildren()) {
200  Detail d = ((Row)row).getDetailChild();
201  if(d != null) {
202  d.setOpen(true);
203  Events.postEvent(new Event(Events.ON_OPEN, d));
204  }
205  }
206  }
Here is the call graph for this function:

◆ refine()

void org.turro.zkoss.grid.PagingGrid.refine ( )

Definition at line 81 of file PagingGrid.java.

81  {
82  InputDialog.getInput(
83  getPage(),
84  I_.get("Refine search"),
85  new InputField[] {
86  new InputField("Text", refineValue, null, 0)
87  }, new Command() {
88  @Override
89  public Object execute(Context context) {
90  InputField[] fields = (InputField[]) context.get("fields");
91  if(fields.length > 0) {
92  for(InputField f : fields) {
93  if("Text".equals(f.getLabel())) {
94  setRefineValue((String) f.getValue());
95  }
96  }
97  }
98  return null;
99  }
100  });
101  }
void setRefineValue(String value)
Here is the call graph for this function:

◆ setColumns() [1/2]

void org.turro.zkoss.grid.PagingGrid.setColumns ( int  columns)

Definition at line 53 of file PagingGrid.java.

53  {
54  setSpan(true);
55  Columns cols = new Columns();
56  for(int i = 0; i < columns; i++) {
57  Column col = new Column();
58  col.setHflex("min");
59  cols.appendChild(col);
60  }
61  appendChild(cols);
62  }

◆ setColumns() [2/2]

void org.turro.zkoss.grid.PagingGrid.setColumns ( String  hflexs)

Definition at line 64 of file PagingGrid.java.

64  {
65  setSpan(true);
66  String hfs[] = hflexs.split(",");
67  Columns cols = new Columns();
68  for(int i = 0; i < hfs.length; i++) {
69  Column col = new Column();
70  if(hfs[i].startsWith("right-")) {
71  col.setAlign("right");
72  col.setHflex(hfs[i].substring(6));
73  } else {
74  col.setHflex(hfs[i]);
75  }
76  cols.appendChild(col);
77  }
78  appendChild(cols);
79  }

◆ setDefaultBehavior()

void org.turro.zkoss.grid.PagingGrid.setDefaultBehavior ( boolean  defaultBehavior)

Definition at line 107 of file PagingGrid.java.

107  {
108  this.defaultBehavior = defaultBehavior;
109  }
Here is the caller graph for this function:

◆ setHeadersVisible()

void org.turro.zkoss.grid.PagingGrid.setHeadersVisible ( boolean  value)

Definition at line 162 of file PagingGrid.java.

162  {
163  getColumns(true).setVisible(value);
164  }
Here is the call graph for this function:

◆ setMaxResults()

void org.turro.zkoss.grid.PagingGrid.setMaxResults ( int  maxResults)

Definition at line 125 of file PagingGrid.java.

125  {
126  this.maxResults = maxResults;
127  }
Here is the caller graph for this function:

◆ setPagingMold()

void org.turro.zkoss.grid.PagingGrid.setPagingMold ( String  pagingMold)

Definition at line 133 of file PagingGrid.java.

133  {
134  this.pagingMold = pagingMold;
135  }

◆ setRefineValue()

void org.turro.zkoss.grid.PagingGrid.setRefineValue ( String  value)

Definition at line 115 of file PagingGrid.java.

115  {
116  this.refineValue = value;
117  renderAll();
118  doRefine();
119  }
Here is the caller graph for this function:

◆ setRowCount()

void org.turro.zkoss.grid.PagingGrid.setRowCount ( int  rows)

Definition at line 141 of file PagingGrid.java.

141  {
142  if(defaultBehavior) {
143  setVflex(true);
144  if(rows > maxResults) {
145  setMold("paging");
146  //setPageSize((int) (maxResults * 0.80));
147  setAutopaging(true);
148  setPagingPosition("bottom");
149  getPagingChild().setMold(pagingMold);
150  } else {
151  setMold("default");
152  setAutopaging(false);
153  }
154  } else {
155  setMold("paging");
156  setPageSize((int) (maxResults * 0.80));
157  setPagingPosition("both");
158  getPagingChild().setMold(pagingMold);
159  }
160  }
Here is the caller graph for this function:

◆ setVarColumns()

void org.turro.zkoss.grid.PagingGrid.setVarColumns ( String  varColumns)

Definition at line 174 of file PagingGrid.java.

174  {
175  this.varColumns = varColumns;
176  }

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