Join Todd Perkins for an in-depth discussion in this video Working with tasks, part of Eclipse Essential Training.
- Eclipse has a built in way of helping organize your to do list with tasks you need to complete in your projects. That's through the Tasks view. You can get to the Task view by going to Windows, Show View, Tasks. Note that there is one called Task List which is different. I'll talk a little bit about that at the end of this movie. But for now we're going to use the Tasks view. When you open up the Tasks view you might see a task already inside of this table.
That's because I have the Refactoring project already inside of this work space. And when I created that project I created a Java class called ClassA and I chose to have Eclipse auto create a Void method for me. And when it did that it created a task and that's what we see on Line five. So I'm going to close ClassA and close the Refactoring project. And now we'll look at how to add you own tasks in Eclipse.
So let's say I have something I need to do with this class here. I'm going to right click one of the lines inside of the table in the Tasks view and I'm going to click Add Task. In this menu I can type a description for the task. Let's say I'm going to do something simple like Add code to Tasks class. So it's a really simple reminder, and I can set the Priority and I can choose to set it as Completed or not completed.
And then there's these other text fields, On element, In folder, and Location. If I try to edit them I can't. And these are the fields that you use to connect a task to a specific line of code in a specific file. So the way that I added this task does not allow to edit those options. So I'll click Okay, and there is my Add code to Tasks class task and I can click the check box to mark it as complete. So note this is not connected to any particular line of code, so if you just need a reminder that you need to work on something that's general, maybe it doesn't apply to a specific area of code, you can create a task like that.
For now I'm just going to delete this task and click Yes to confirm the deletion. And I'm going to add a task by connecting it to a specific line of code. So if I right click in the area to the left of my line number, see that gray vertical bar to the left of my line numbers, I'm going to click there and I'm going to choose Add Task. Now because I click to the left of Line two I see that line's code in the description by default in the Task Properties window.
So I'm gonna change this to Add code to Tasks class, I'm going to change the description to Add code to Tasks class. I'm going to leave the Priority at Normal and leave the rest of the text fields as they are. Note that On Element, In folder, and Location are all set. So I'll click Okay. Now I've created a task and we can see all the information about it inside of the Tasks view. Now the great thing about connecting a task to a line of code is that I can double click the task in the Tasks view and automatically be taken to that code.
So if I double click the task that's connected to my ClassA file in my Refactoring project, the file is open, and I'm taken to the line where that code is written. Similarly, if I double click on Add code to Tasks class task I'm taken to Tasks.Java and the line of code is highlighted where I created the task. So I can create tasks in all types of projects in the same work space and double click to navigate between them.
So tasks are a helpful way to organize your to do list in your project. Note that you can mark a task as complete by clicking the box on the left side of the Task view, and if you right click inside of the Task view you can choose to delete all completed tasks, so I'll do that now. Then I'll confirm by clicking Okay, so there goes that task. Now I mentioned that I'd talk about the Task List view, as well. Now I also mentioned I would talk about Task List view, as well.
The Task List view is actually a little bit more complicated because it's connected to something called Mylyn. Now Mylyn is actually a technology used for managing more complex tasks. Now you think of creating a task like we did now, but also being able to say more specifically what you're going to be working on. For example, fixing a bug, or something else like that. Also Mylyn can track the amount of time that you spend working on a task. Since Mylyn is such a big topic that it could be covered in its own course, let alone in its own chapter in this course, I've chosen not to cover it in detail in this course.
However, if you are interested in controlling more complex tasks through Mylyn I'm going to refer you to the Eclipse documentation. You can find that at help.eclipse.org. In the Eclipse documentation, scroll down until you see the Mylyn Documentation. There's a massive section here with lots of features and sub-features explaining how Mylyn works and how to manage the tasks in the Task List view.
And you can see very quickly, and early on, that this is much more complicated than what we talked about with the Task view. So again, if you want to learn more about Mylyn I recommend going to the Eclipse documentation. So to review, the Tasks view can be found under WIndow, Show View, Tasks. using the Tasks view you can quickly navigate between items on your to do list in projects inside of a work space.
- What is Eclipse?
- Setting up a workspace
- Adding external files to a project
- Installing add-ons
- Refactoring code
- Working with tasks
- Customizing formatting
- Using Git for version control
- Developing Java, PHP, C/C++, Perl, and Python apps with Eclipse
- Setting up testing servers
- Testing apps
- Debugging apps