Home > Articles > Programming > Java

  • Print
  • + Share This
This chapter is from the book

Tracking Notes to Yourself in Your Code

The IDE has a task list feature that provides a way for you to write notes in your code and then view all of these notes in a single task (or "to do") list. You can use the task list as the center of operations when cleaning up loose ends in your code.

A line is displayed in the task list if it is "tagged" with (contains) any of the following text:

  • @todo
  • TODO
  • FIXME
  • XXX
  • PENDING
  • <<<<<<<

To view the task list, choose Window | To Do (or press Ctrl-6).

Once you have displayed the To Do window (shown in Figure 5-18), you can view tasks for the current file, for all open files, or for a specific folder by clicking the corresponding button at the top of the To Do window.

keegan_fig05_18.jpg

Figure 5-18 To Do window

You can sort task-list items by task, location, or priority by clicking the corresponding column titles. See Displaying Tasks by Priority later in this chapter for information on displaying the Priority column.

You can jump from an entry in the task list straight to the line in the code where you wrote the note by double-clicking the entry.

Adding, Removing, and Changing Task-List Tags

To change the tags that are used for the task list:

  1. Choose Tools | Options, click Advanced Options, and select the Editing | To Do Settings node.
  2. Click the keegan_04_ellipsisbutton.jpg button in the Task Tags property.
  3. In the To Do Settings dialog box, use the Add, Change, and Delete buttons to modify the contents of the Task List table.

Displaying Tasks by Priority

You can also display priorities for each task-list item. The available priorities are High, Medium-High, Medium, Medium-Low, and Low.

By default, the Priority column is not displayed. You can display the Priority column by clicking the keegan_05_changecolumn.jpg icon and selecting the Priority checkbox in the Change Visible Columns dialog box.

The priority values can be assigned by tag. By default, all tags are assigned Medium priority except the <<<<<<< tag, which is given High priority.

To change a priority value for a tag:

  1. Choose Tools | Options, click Advanced Options, and select the Editing | To Do Settings node.
  2. Click the keegan_04_ellipsisbutton.jpg button in the Task Tags property.
  3. In the To Do Settings dialog box, select the new priority in the combo box in the Priority column for the tag that you want to change.

Filtering Task-List Entries

You can further limit the entries displayed in the task list by creating and using filters. When you use a filter, only entries that match criteria specified by the filter are displayed. Criteria include text that needs to appear in the note, the priority of the task, and/or the filename.

To create a filter:

  1. Click the keegan_04_todofilter.jpg icon in the To Do window's toolbar.
  2. In the Edit Filters dialog box, click the New button and then type a name for the filter in the Name field.
  3. Fill in the details for the criterion.
  4. Optionally, add additional criteria by clicking the More button and then filling in the details for the filters. You can select to have the filter match all or any of the criteria using the radio buttons at the top of the dialog box.

An entry for the newly defined filter appears in a combo box in the To Do Window toolbar.

  • + Share This
  • 🔖 Save To Your Account