19 package org.turro.zul.starit;
21 import org.turro.contacts.StarIt;
22 import org.turro.elephant.context.Application;
23 import org.turro.i18n.I_;
24 import org.turro.starit.StarItUtil;
25 import org.turro.zkoss.grid.PagingGrid;
26 import org.turro.zkoss.label.LabelExtended;
27 import org.zkoss.zk.ui.ext.AfterCompose;
28 import org.zkoss.zul.Column;
29 import org.zkoss.zul.Columns;
30 import org.zkoss.zul.Label;
31 import org.zkoss.zul.Row;
32 import org.zkoss.zul.Rows;
41 private String entityPath;
48 this.entityPath = entityPath;
56 private void addColumns() {
57 Columns cols =
new Columns();
58 cols.setSizable(
true);
59 cols.setMenupopup(
"auto");
62 Column col =
new Column(
I_.
get(
"Date"),
null,
"120px");
63 cols.appendChild(col);
65 col =
new Column(
I_.
get(
"Author"));
66 cols.appendChild(col);
68 col =
new Column(
I_.
get(
"Votes"),
null,
"80px");
69 col.setAlign(
"right");
70 cols.appendChild(col);
73 private void addRows() {
75 rows.getChildren().clear();
77 for(
final StarIt si : StarItUtil.allStars(entityPath)) {
78 final Row row =
new Row();
80 rows.appendChild(row);
82 LabelExtended lext =
new LabelExtended();
83 lext.setDate(si.getDateCreation());
84 lext.setSclass(
"ldate");
85 row.appendChild(lext);
87 row.appendChild(
new Label(si.getAuthor_ip()));
89 row.appendChild(
new Label(si.getStars() +
""));
static Application getApplication()
static String get(String msg)
Rows getRows(boolean create)
void setEntityPath(String entityPath)