19 package org.turro.dossier.zul.dossier;
21 import java.util.Date;
22 import java.util.logging.Level;
23 import java.util.logging.Logger;
24 import org.turro.string.Strings;
25 import org.turro.action.Contacts;
26 import org.turro.action.queue.ConstraintKeys;
27 import org.turro.assistant.Assistant;
28 import org.turro.assistant.AssistantSet;
29 import org.turro.assistant.Assistants;
30 import org.turro.contacts.Contact;
31 import org.turro.contacts.util.ContactCombobox;
32 import org.turro.dossier.dossier.ParticipantSet;
33 import org.turro.dossier.entity.CategoryParticipant;
34 import org.turro.dossier.entity.Dossier;
35 import org.turro.dossier.entity.Participant;
36 import org.turro.dossier.entity.ParticipantRole;
37 import org.turro.elephant.context.ElephantContext;
38 import org.turro.elephant.util.Images;
39 import org.turro.entities.EntityCombobox;
40 import org.turro.i18n.I_;
41 import org.turro.jpa.entity.EntityCollections;
42 import org.turro.mail.queue.QueueManager;
43 import org.turro.plugin.contacts.IContact;
44 import org.turro.zkoss.grid.ChangeValueCallback;
45 import org.turro.zkoss.grid.CollectionGrid;
46 import org.turro.zkoss.grid.EditableCell;
47 import org.turro.zkoss.grid.EditableColumn;
48 import org.zkoss.zk.ui.HtmlBasedComponent;
49 import org.zkoss.zk.ui.event.Event;
50 import org.zkoss.zk.ui.event.Events;
51 import org.zkoss.zk.ui.util.Clients;
52 import org.zkoss.zul.Row;
67 this.dossier = dossier;
72 this.dossier = dossier;
122 p.
setName(a.contact.getName());
130 Events.postEvent(
new Event(Events.ON_CHANGE));
172 cit.setMold(
"select");
181 return super.createEditor(editableCell);
195 return I_.
byKey(cit.toString());
199 return super.formatCell(editableCell, value);
205 HtmlBasedComponent hbc = (HtmlBasedComponent) editableCell.
getEditor();
216 return super.getEditorValue(editableCell);
219 private void addColumns() {
225 public boolean check(Object newValue, Object rowValue) {
226 if(!Strings.isBlank((String) newValue) && ((String) newValue).equals(((
Participant) rowValue).getIdContact())) {
227 Clients.showNotification(
I_.
format(
"%s already exists", ((
Participant) rowValue).getName()));
234 addColumn(I_.get(
"Discriminator"), String.class,
"discriminator",
null, 0,
false,
false).setHflex(
"2");
235 addColumn(Images.getImage(
"clip"), I_.get(
"Show all attachments"),
"boolean",
"showAllAttachments",
null, 0,
true,
false).setWidth(
"25px");
236 addColumn(Images.getImage(
"issue"), I_.get(
"Show all issues"),
"boolean",
"showAllIssues",
null, 0,
true,
false).setWidth(
"25px");
237 addColumn(Images.getImage(
"mail_forward"), I_.get(
"Receive all emails"),
"boolean",
"receiveAllEmails",
null, 0,
true,
false).setWidth(
"25px");
238 addColumn(Images.getImage(
"contacts"), I_.get(
"Show participants"),
"boolean",
"showParticipants",
null, 0,
true,
false).setWidth(
"25px");
239 addColumn(Images.getImage(
"accepted"), I_.get(
"Binding votes"),
"boolean",
"bindingVote",
null, 0,
true,
false).setWidth(
"25px");
240 addColumn(Images.getImage(
"driver"), I_.get(
"Driver"),
"boolean",
"driver",
null, 0,
true,
false).setWidth(
"25px");
241 addColumn(Images.getImage(
"coordinator"), I_.get(
"Coordinator"),
"boolean",
"coordinator",
null, 0,
true,
false).setWidth(
"25px");
242 addColumn(Images.getImage(
"beneficiary"), I_.get(
"Beneficiary"),
"boolean",
"beneficiary",
null, 0,
true,
false).setWidth(
"25px");
243 addColumn(Images.getImage(
"offerer"), I_.get(
"Offerer"),
"boolean",
"offerer",
null, 0,
true,
false).setWidth(
"25px");
244 addColumn(Images.getImage(
"research"), I_.get(
"R&D"),
"boolean",
"research",
null, 0,
true,
false).setWidth(
"25px");
245 addColumn(Images.getImage(
"funding"), I_.get(
"Funding"),
"boolean",
"funding",
null, 0,
true,
false).setWidth(
"25px");
246 addColumn(Images.getImage(
"support"), I_.get(
"Support"),
"boolean",
"support",
null, 0,
true,
false).setWidth(
"25px");
247 addColumn(Images.getImage(
"consortium"), I_.get(
"Consortium"),
"boolean",
"consortium",
null, 0,
true,
false).setWidth(
"25px");
248 addColumn(Images.getImage(
"admin"), I_.get(
"Administrator"),
"boolean",
"admin",
null, 0,
true,
false).setWidth(
"25px");
255 }
catch (ClassNotFoundException ex) {
256 Logger.getLogger(DossierVersionGrid.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
static void addAssistantsFromEntity(Object entity, boolean deep, AssistantSet list, Object data)
boolean isShowAllIssues()
ParticipantRole getRole()
boolean isReceiveAllEmails()
String getDiscriminator()
boolean isShowParticipants()
boolean isShowAllAttachments()
Set< Participant > getParticipants()
boolean existsParticipant(IDossierParticipant participant)
boolean isReceiveAllEmails()
boolean isShowAllIssues()
void setBindingVote(boolean bindingVote)
void setReceiveAllEmails(boolean receiveAllEmails)
void setName(String name)
void setShowParticipants(boolean showParticipants)
void setDiscriminator(String discriminator)
boolean isShowAllAttachments()
boolean isShowParticipants()
void setShowAllAttachments(boolean showAllAttachments)
void setIdContact(String idContact)
ParticipantRole getRole()
void setCreation(Date creation)
void setShowAllIssues(boolean showAllIssues)
void setDossier(Dossier dossier)
String getDiscriminator()
void setRole(ParticipantRole role)
void setDriver(boolean driver)
void addAttendeesByEntity(EntityCombobox entity, boolean deep)
void setDossier(Dossier dossier)
boolean deleteRow(Row row)
HtmlBasedComponent createEditor(EditableCell editableCell)
void initiateRow(Row row, Participant value)
Object getEditorValue(EditableCell editableCell)
boolean isValid(Participant v)
String formatCell(EditableCell editableCell, Object value)
DossierParticipantGrid(Dossier dossier)
static String format(String msg, Object... arguments)
static String byKey(String key)
static String get(String msg)
static EntityCollections entities(Collection values)
void setCollection(Collection< V > collection)
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)