JavaPerspective.com > Intermediate Tutorials > 1. The Eclipse IDE > 1.3. Tips about Eclipse > 1.3.6. How to use TODO and FIXME task tags in Eclipse
1.3.6. How to use TODO and FIXME task tags in Eclipse
Last updated: 25 January 2013.
Sometimes, when you are developing an application, you may define methods and decide to implement them later. However, if you are working on a large application, it becomes difficult to keep track of all the tasks awaiting you. In order to help developers address that issue, Eclipse provides a predefined list of task tags that you can add to your code and view in a single location: the task view.
A task tag must be written within a comment or javadoc-style comment. When you add a task tag to your code, it is registered in the task view when the source file is saved. Likewise, when you remove a task tag from your code, it is removed from the task view when the source file is saved. As an example, there is a TODO task tag and a FIXME task tag in the class JavaLoops shown below:
A task tag must be written in capital letters. To display the task view, click Window -> Show View -> Tasks in the menu bar as shown below:
The task view appears at the bottom and lists the tasks of all projects. To display a task, just double-click it.
To view the list of predefined tags, click Window -> Preferences (Linux and Windows users) or Eclipse -> Preferences (Mac users) in the menu bar as shown below:
In the Preferences dialog box, click Java -> Compiler -> Task Tags:
As you can see, the TODO and FIXME task tags do not have the same priority. The 3 priorities are High, Normal and Low. In the task view, the tasks are listed in decreasing order of priority. Note that you can create your own custom tags.
In this tutorial, you have learned a simple way to use task tags for your projects. However, you may have noticed that there is a Task List tab in Eclipse. That task list uses a more advanced task manager called Mylyn whose documentation can be found on the official website.