19 package org.turro.zul.fieldit;
21 import java.util.logging.Level;
22 import java.util.logging.Logger;
23 import org.turro.contacts.FieldIt;
24 import org.turro.elephant.context.ElephantContext;
25 import org.turro.elephant.util.Images;
26 import org.turro.entities.Entities;
27 import org.turro.fieldit.FieldItUtil;
28 import org.turro.fieldit.StringList;
29 import org.turro.i18n.I_;
30 import org.turro.reflection.Reflections;
31 import org.turro.zkoss.grid.CollectionGrid;
32 import org.turro.zkoss.grid.EditableCell;
33 import org.turro.zkoss.text.FileEditor;
34 import org.zkoss.zk.ui.HtmlBasedComponent;
35 import org.zkoss.zk.ui.event.Event;
36 import org.zkoss.zk.ui.event.EventListener;
37 import org.zkoss.zk.ui.event.Events;
38 import org.zkoss.zul.Radio;
39 import org.zkoss.zul.Row;
47 private String entityPath;
59 this.entityPath = entityPath;
103 Radio el =
new Radio();
106 el.addEventListener(Events.ON_CHECK,
new EventListener<Event>() {
108 public void onEvent(Event event) throws Exception {
109 if(h.getId() != null) {
110 FileEditor.editFile(StringList.getValueFile(h));
115 el.setDisabled(
true);
119 return super.createEditor(editableCell);
128 return super.getEditorValue(editableCell);
138 return super.formatCell(editableCell, value);
141 private void addColumns() {
143 addColumn(
I_.
get(
"Name"), String.class,
144 "name",
null, 0,
false,
false).setWidth(
"35%");
145 addColumn(
I_.
get(
"Type"), Class.class,
146 "javaClass",
null, 0,
false,
false).setWidth(
"25%");
147 addColumn(
I_.
get(
"Ordering"),
"int",
148 "order",
null, 0,
false,
false).setWidth(
"8%");
149 addColumn(
I_.
get(
"Description"),
"boolean",
150 "description",
null, 0,
false,
false).setWidth(
"8%");
151 addColumn(
I_.
get(
"Publishable"),
"boolean",
152 "publishable",
null, 0,
false,
false).setWidth(
"8%");
153 addColumn(
I_.
get(
"Composite"),
"boolean",
154 "composite",
null, 0,
false,
false).setWidth(
"8%");
155 addColumn(
I_.
get(
"Searchable"),
"boolean",
156 "searchable",
null, 0,
false,
false).setWidth(
"8%");
158 null,
null, 0,
false,
false).setWidth(
"8%");
159 }
catch (ClassNotFoundException ex) {
160 Logger.getLogger(FieldItGrid.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
static String getImage(String image)
static IElephantEntity getController(String path)
static void delete(FieldIt field)
static FieldItSet fields(Object entity)
static String getLabel(Class javaClass)
static String get(String msg)
void updateCollection(Collection< V > collection)
void setShowZeros(boolean showZeros)
void setObjectValue(Class javaClass)
String formatCell(EditableCell editableCell, Object value)
void initiateRow(Row row, FieldIt value)
HtmlBasedComponent createEditor(EditableCell editableCell)
boolean isValid(FieldIt v)
boolean deleteRow(Row row)
Object getEditorValue(EditableCell editableCell)
void setEntityPath(String entityPath)
void setEntity(Object entity)