- Opening the Source Editor
- Managing Automatic Insertion of Closing Characters
- Displaying Line Numbers
- Generating Code Snippets without Leaving the Keyboard
- Using Code Completion
- Inserting Snippets from Code Templates
- Using Editor Hints to Generate Missing Code
- Matching Other Words in a File
- Generating Methods to Implement and Override
- Generating JavaBeans Component Code
- Creating and Using Macros
- Creating and Customizing File Templates
- Handling Imports
- Displaying Javadoc Documentation While Editing
- Formatting Code
- Text Selection Shortcuts
- Navigating within the Current Java File
- Navigating from the Source Editor
- Searching and Replacing
- Deleting Code Safely
- Changing a Method's Signature
- Encapsulating a Field
- Moving a Class to a Different Package
- Moving Class Members to Other Classes
- Creating a Method from Existing Statements
- Creating an Interface from Existing Methods
- Extracting a Superclass to Consolidate Common Methods
- Changing References to Use a Supertype
- Unnesting Classes
- Tracking Notes to Yourself in Your Code
- Comparing Differences Between Two Files
- Splitting the Source Editor
- Maximizing Space for the Source Editor
- Changing Source Editor Keyboard Shortcuts
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.
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:
- Choose Tools | Options, click Advanced Options, and select the Editing | To Do Settings node.
- Click the button in the Task Tags property.
- 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 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:
- Choose Tools | Options, click Advanced Options, and select the Editing | To Do Settings node.
- Click the button in the Task Tags property.
- 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:
- Click the icon in the To Do window's toolbar.
- In the Edit Filters dialog box, click the New button and then type a name for the filter in the Name field.
- Fill in the details for the criterion.
- 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.