Exemplo n.º 1
0
 /**
  * Writes tasks explicitly shown in the timeline as comma-separated list of task identifiers in
  * CDATA section of <timeline> element.
  */
 private void writeTimelineTasks(UIFacade facade, TransformerHandler handler) throws SAXException {
   AttributesImpl attrs = new AttributesImpl();
   Set<Task> timelineTasks = facade.getCurrentTaskView().getTimelineTasks();
   if (timelineTasks.isEmpty()) {
     return;
   }
   Function<Task, String> getId =
       new Function<Task, String>() {
         @Override
         public String apply(Task t) {
           return String.valueOf(t.getTaskID());
         }
       };
   cdataElement(
       "timeline",
       Joiner.on(',').join(Collections2.transform(timelineTasks, getId)),
       attrs,
       handler);
 }