예제 #1
0
파일: TodoItem.java 프로젝트: abruzzi/stodo
  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;
  }
예제 #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");
   }
 }