19 package org.turro.zul.voteit;
21 import org.turro.command.CommandUtil;
22 import org.turro.contacts.VoteIt;
23 import org.turro.elephant.context.Application;
24 import org.turro.i18n.I_;
25 import org.turro.voteit.VoteItUtil;
26 import org.turro.zkoss.grid.PagingGrid;
27 import org.turro.zkoss.label.LabelExtended;
28 import org.zkoss.zk.ui.ext.AfterCompose;
29 import org.zkoss.zul.Column;
30 import org.zkoss.zul.Columns;
31 import org.zkoss.zul.Label;
32 import org.zkoss.zul.Row;
33 import org.zkoss.zul.Rows;
42 private String entityPath;
49 this.entityPath = entityPath;
57 private void addColumns() {
58 Columns cols =
new Columns();
59 cols.setSizable(
true);
60 cols.setMenupopup(
"auto");
63 Column col =
new Column(
I_.
get(
"Date"),
null,
"120px");
64 cols.appendChild(col);
66 col =
new Column(
I_.
get(
"Author"));
67 cols.appendChild(col);
69 col =
new Column(
I_.
get(
"Votes"),
null,
"80px");
70 col.setAlign(
"right");
71 cols.appendChild(col);
74 private void addRows() {
76 rows.getChildren().clear();
78 for(
final VoteIt vi : VoteItUtil.allVotes(entityPath)) {
79 final Row row =
new Row();
81 rows.appendChild(row);
83 LabelExtended lext =
new LabelExtended();
84 lext.setDate(vi.getDateCreation());
85 lext.setSclass(
"ldate");
86 row.appendChild(lext);
88 row.appendChild(CommandUtil.getLinkOrSpace(vi.getCreator()));
90 row.appendChild(
new Label(vi.getVote() +
""));
static Application getApplication()
static String get(String msg)
Rows getRows(boolean create)
void setEntityPath(String entityPath)