19 package org.turro.dossier.zul.dossier;
21 import java.util.logging.Level;
22 import java.util.logging.Logger;
23 import org.turro.string.Strings;
24 import org.turro.action.Contacts;
25 import org.turro.contacts.Contact;
26 import org.turro.contacts.util.ContactCombobox;
27 import org.turro.dossier.dossier.ParticipantSet;
28 import org.turro.dossier.entity.Category;
29 import org.turro.dossier.entity.CategoryParticipant;
30 import org.turro.dossier.entity.ParticipantRole;
31 import org.turro.elephant.context.ElephantContext;
32 import org.turro.elephant.util.Images;
33 import org.turro.i18n.I_;
34 import org.turro.jpa.entity.EntityCollections;
35 import org.turro.plugin.contacts.IContact;
36 import org.turro.zkoss.grid.ChangeValueCallback;
37 import org.turro.zkoss.grid.CollectionGrid;
38 import org.turro.zkoss.grid.EditableCell;
39 import org.turro.zkoss.grid.EditableColumn;
40 import org.zkoss.zk.ui.HtmlBasedComponent;
41 import org.zkoss.zk.ui.util.Clients;
42 import org.zkoss.zul.Row;
58 this.category = category;
63 this.category = category;
64 if(category !=
null) {
76 if(category !=
null) {
107 cit.setMold(
"select");
116 return super.createEditor(editableCell);
128 return super.formatCell(editableCell, value);
134 HtmlBasedComponent hbc = (HtmlBasedComponent) editableCell.
getEditor();
145 return super.getEditorValue(editableCell);
148 private void addColumns() {
153 public boolean check(Object newValue, Object rowValue) {
154 if(!Strings.isBlank((String) newValue) && ((String) newValue).equals(((
CategoryParticipant) rowValue).getIdContact())) {
162 addColumn(I_.get(
"Role"), ParticipantRole.class,
"role",
null, 0,
false,
false).setHflex(
"1");
163 addColumn(I_.get(
"Discriminator"), String.class,
"discriminator",
null, 0,
false,
false).setHflex(
"2");
164 addColumn(Images.getImage(
"clip"), I_.get(
"Show all attachments"),
"boolean",
"showAllAttachments",
null, 0,
true,
false).setWidth(
"25px");
165 addColumn(Images.getImage(
"issue"), I_.get(
"Show all issues"),
"boolean",
"showAllIssues",
null, 0,
true,
false).setWidth(
"25px");
166 addColumn(Images.getImage(
"mail_forward"), I_.get(
"Receive all emails"),
"boolean",
"receiveAllEmails",
null, 0,
true,
false).setWidth(
"25px");
167 addColumn(Images.getImage(
"contacts"), I_.get(
"Show participants"),
"boolean",
"showParticipants",
null, 0,
true,
false).setWidth(
"25px");
168 addColumn(Images.getImage(
"accepted"), I_.get(
"Binding votes"),
"boolean",
"bindingVote",
null, 0,
true,
false).setWidth(
"25px");
169 addColumn(Images.getImage(
"driver"), I_.get(
"Driver"),
"boolean",
"driver",
null, 0,
true,
false).setWidth(
"25px");
170 addColumn(Images.getImage(
"coordinator"), I_.get(
"Coordinator"),
"boolean",
"coordinator",
null, 0,
true,
false).setWidth(
"25px");
171 addColumn(Images.getImage(
"beneficiary"), I_.get(
"Beneficiary"),
"boolean",
"beneficiary",
null, 0,
true,
false).setWidth(
"25px");
172 addColumn(Images.getImage(
"offerer"), I_.get(
"Offerer"),
"boolean",
"offerer",
null, 0,
true,
false).setWidth(
"25px");
173 addColumn(Images.getImage(
"research"), I_.get(
"R&D"),
"boolean",
"research",
null, 0,
true,
false).setWidth(
"25px");
174 addColumn(Images.getImage(
"funding"), I_.get(
"Funding"),
"boolean",
"funding",
null, 0,
true,
false).setWidth(
"25px");
175 addColumn(Images.getImage(
"support"), I_.get(
"Support"),
"boolean",
"support",
null, 0,
true,
false).setWidth(
"25px");
176 addColumn(Images.getImage(
"consortium"), I_.get(
"Consortium"),
"boolean",
"consortium",
null, 0,
true,
false).setWidth(
"25px");
177 addColumn(Images.getImage(
"admin"), I_.get(
"Administrator"),
"boolean",
"admin",
null, 0,
true,
false).setWidth(
"25px");
178 }
catch (ClassNotFoundException ex) {
179 Logger.getLogger(DossierVersionGrid.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
void setCategory(Category category)
Set< CategoryParticipant > getParticipants()
void setCategory(Category category)
Object getEditorValue(EditableCell editableCell)
void initiateRow(Row row, CategoryParticipant value)
HtmlBasedComponent createEditor(EditableCell editableCell)
CategoryParticipantGrid(Category category)
String formatCell(EditableCell editableCell, Object value)
boolean isValid(CategoryParticipant v)
CategoryParticipantGrid()
boolean deleteRow(Row row)
static String format(String msg, Object... arguments)
static String get(String msg)
static EntityCollections entities(Collection values)
void updateCollection(Collection< V > collection)
void setOnCheckDuplicate(ChangeValueCallback onCheckDuplicate)
EditableColumn addColumn(String label, Class javaClass, String property, String format, int scale, boolean onlyDate, boolean readOnly)
Object getCellValue(EditableCell editableCell)