Declaration View

Declaration View is very useful when we are working on big projects. At times we need to look at the declaration of various variables and definition of methods and classes. To do the same, we need to open the files in which the methods and classes are defined. Declaration view provides an alternative solution to this problem.

Declaration view provides the following information about the selected Element, where the Element can be a Variable, Class, Interface or Method:

  • Access Modifiers associated with the Element.
  • Other Information provided will vary depending upon the type of the Element. The various types possible are:
    • Variable: Shows the Declaration of the Variable.
    • Method: Shows complete Definition of the Method.
    • Class/Interface: Shows complete definition of the Class/Interface.

Tasks View

Tasks view is a view using which we can track various tasks that we have to do. To know how to open the Tasks View, see this post.

There are two types of Tasks, Linked Tasks and unlinked Tasks.

Linked Tasks: Linked Tasks are tasks that are linked or related to a specific location or file. For Example, if you are working on some program and have to stop your work due to some reasons and want to remind yourself that you need to write some code at a specific location, you will use linked tasks.

In the Tasks view, when you double click on any Linked Task, it will open the file to which the task is linked and the cursor will be pointing to the line where the task was linked. Following are the methods of creating a Linked Task:

  1. Right Click the Ruler corresponding to the File/Line to which you want to link the task and select Add Task option.
  2. On the line where the Task is to be Linked, write:

// TODO Task To Be Done

This will also place the Task in the Tasks view, linking it with the line the Comment was written on, and will show Task To Be Done in Description Field.

Unlinked Tasks: Unlinked tasks are the tasks that are not related to any specific file or line. These are tasks of more General Nature. These tasks might Include, Mail Sam when Work is Over.

To add an Unlinked task, Right Click in the Tasks View and select Add Task.

Priority: We can define the priority of each task. Three available Priority levels are:

  1. High: Represented by an Red Exclamation Mark.
  2. Normal: No special symbols used.
  3. Low: Represented by an Arrow Facing Downwards.

Other Details that are shown in the Tasks View are:

  1. Description: This gives the description of the task.
  2. Resource: Gives the name of the file where the task is linked to.
  3. Path: Gives the absolute path of the File to which the task is related (minus the File Name).
  4. Location: Gives the Line Number of the related Line.
  5. Type: Gives the type of task.
  6. Priority: Inform about the task priority.
  7. Completion: Informs whether the task is completed or not.

Opening View

Even though Eclipse Perspectives are well decorated with all the views that we need for that perspective, some times we want to see things that are not present in the perspective. For Example, we might want to see the Tasks view in Java perspective. To solve this problem, we can open any view that we want to see despite of any perspective being open.

To Open a view, follow these steps:

Go to Windows->Show View

Here, without clicking, you will see a list of views that you can open. If the view you want to open is in the list, select it and it will open. If the view you want to see is not in the list, click on Other at the end of the list.

When you will click on other, a Dialog Box will open.In this dialog box, you can see list of all the views that are available for your Eclipse. Select the appropriate category and choose the view, or type something in Filter Text and filter the list of Views.