Exemple #1
0
  private JournalElement getElementFromGroup(String eltId, JournalGroup grp) {
    JournalElement e = alias(JournalElement.class);
    JournalElement elt =
        from($(e), grp.getElements()).where($(e.getId()).eq(eltId)).uniqueResult($(e));

    return elt;
  }
Exemple #2
0
 private void removeElement(JournalElement elt) {
   setCurrentEltAndGrp(elt, elt.getGroup());
   elt.removeFromGroup();
   elementDeletedList.add(elt.getId());
   if (request.isXHR()) ajaxResponseRenderer.addRender(elementZone);
   eventBusRecorder.post(new JournalDeleteEvent(elt));
 }
Exemple #3
0
 public void onEditElement(String eltId, String gpId) {
   JournalElement elt = getElementFromGroup(eltId, getGroupFromGroupsList(gpId));
   group = elt.getGroup();
   element = elt;
   eventBusRecorder.post(new JournalEditEvent(elt));
   elementEditedId = element.getId();
   if (request.isXHR()) ajaxResponseRenderer.addRender(journalZone);
 }
Exemple #4
0
 private void createElement(JournalElement elt, JournalGroup grp) {
   group = grp;
   if (elementDeletedList.contains(elt.getId())) elementDeletedList.remove(elt.getId());
   group.add(elt);
   element = elt;
   elementEditedId = element.getId();
   if (request.isXHR()) ajaxResponseRenderer.addRender(journalZone);
 }
Exemple #5
0
 public void onDisplayAll() {
   for (JournalGroup grp : groups) {
     for (JournalElement elt : grp.getElements()) {
       if (!summaryList.contains(elt.getId())) summaryList.add(elt.getId());
     }
   }
   if (request.isXHR()) {
     ajaxResponseRenderer.addRender(journalZone);
   }
 }
Exemple #6
0
 public String getColorForSelectedElement() {
   if (element.getId().equals(elementEditedId)) {
     return "background-color:white;";
   }
   return "";
 }
Exemple #7
0
 public String getElementZoneId() {
   return "element_" + element.getId();
 }