19 package org.turro.polls;
21 import java.util.logging.Level;
22 import java.util.logging.Logger;
23 import org.turro.elephant.context.ElephantContext;
24 import org.turro.elephant.entities.db.Poll;
25 import org.turro.elephant.entities.db.PollOption;
26 import org.turro.i18n.I_;
27 import org.turro.zkoss.grid.CollectionGrid;
28 import org.turro.zkoss.grid.EditableCell;
29 import org.zkoss.zk.ui.HtmlBasedComponent;
30 import org.zkoss.zul.Row;
47 if(this.poll !=
null) {
56 if(value ==
null && poll !=
null) {
79 if(formatted !=
null)
return formatted;
81 return super.formatCell(editableCell, value);
87 super.setCellValue(editableCell,
formatCell(editableCell, value));
89 super.setCellValue(editableCell, value);
102 return super.createEditor(editableCell);
105 private void addColumns() {
108 "pollData",
null, 0,
false,
false).setHflex(
"3");
110 "description",
null, 0,
false,
false).setHflex(
"3");
112 "actionButton",
null, 0,
false,
false).setHflex(
"1");
114 "ordering",
null, 0,
false,
false).setHflex(
"1");
115 }
catch (ClassNotFoundException ex) {
116 Logger.getLogger(
PollOptionGrid.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
void setIdPoll(Long idPoll)
List< PollOption > getOptions()
static String get(String msg)
static HtmlBasedComponent getEditor(String optionClass, boolean readonly, Object value)
static String getFormattedString(String optionClass, Object value)
void initiateRow(Row row, PollOption value)
boolean isValid(PollOption v)
boolean deleteRow(Row row)
HtmlBasedComponent createEditor(EditableCell editableCell)
void setCellValue(EditableCell editableCell, Object value)
String formatCell(EditableCell editableCell, Object value)
static void removeOption(PollOption po)
void updateCollection(Collection< V > collection)
EditableColumn addColumn(String label, Class javaClass, String property, String format, int scale, boolean onlyDate, boolean readOnly)
Object getCellValue(EditableCell editableCell)