1 19 20 package org.netbeans.modules.tasklist.core; 21 22 import org.openide.text.Annotation; 23 24 26 public class TaskAnnotation extends Annotation { 27 28 30 public TaskAnnotation(Task task) { 31 this(task, true); 32 } 33 34 39 public TaskAnnotation(Task task, boolean highlight) { 40 this.task = task; 41 this.highlight = highlight; 42 } 43 44 51 public TaskAnnotation(Task task, TaskSelector view) { 52 this.task = task; 53 this.view = view; 54 highlight = true; 55 } 56 57 public String getAnnotationType () { 58 if (highlight) { 62 return "Task"; } else { 64 return "TaskNoHighlight"; } 66 } 67 68 public String getShortDescription () { 69 showTask(); 71 72 if (task.getDetails().length() > 0) { 73 return task.getSummary() + "\n\n" + task.getDetails(); 74 } else { 75 return task.getSummary(); 76 } 77 } 78 79 80 protected void showTask() { 81 if (view != null) view.select(task); 82 } 83 84 85 public Task getTask() { 86 return task; 87 } 88 89 90 91 protected Task task = null; 92 private boolean highlight = false; 93 private TaskSelector view; 94 } 95 | Popular Tags |