Ejemplo n.º 1
0
  private static TodoItem _parse_(JSONObject json) {
    TodoItem item = new TodoItem();

    item.setDesc(json.optString("desc", ""));
    item.setType(json.optString("type", "node"));
    item.setTimeout(json.optString("timeout"));
    item.setPeriod(json.optString("period", "never"));
    item.setStatus(json.optString("status", "new"));
    item.setNote(json.optString("note"));

    return item;
  }
Ejemplo n.º 2
0
 public void setTodoItem(TodoItem item) {
   labDesc.setText("<html>" + item.getDesc() + "</html>");
   labDesc.setToolTipText(item.getDesc());
   String status = item.getStatus();
   if (status.equals("new")) {
     panelStatus.setImagePath(inew);
     panelStatus.setToolTipText("Status : new");
   } else if (status.equalsIgnoreCase("finished")) {
     panelStatus.setImagePath(finished);
     panelStatus.setToolTipText("Status : finished");
   } else if (status.equalsIgnoreCase("pending")) {
     panelStatus.setImagePath(pending);
     panelStatus.setToolTipText("Status : pending");
   } else if (status.equalsIgnoreCase("prefect")) {
     panelStatus.setImagePath(prefect);
     panelStatus.setToolTipText("Status : prefect");
   } else if (status.equalsIgnoreCase("cancelled")) {
     panelStatus.setImagePath(cancelled);
     panelStatus.setToolTipText("Status : cancelled");
   } else {
     panelStatus.setImagePath(cancelled);
     panelStatus.setToolTipText("Status : unknown");
   }
 }