gitmylyn

fetch egit Mylyn connector active tasks from another class


I need to know if there is any task activated in the task List While adding files for Git staging?

Edited:

The idea i am looking for is, while doing staging of files, I need to identify if there is an selected task by code from the Git StagingView class?

Any ideas?

Mylyn functionality
(source: uploadimage.in)


Solution

  • If you want to see the active task without having the Task List view open, you can enable the task window trim. Go to Window/Preferences/Mylyn/Tasks and check "Show active task on window trim".

    Other than that, Mylyn will fill in the commit message in the Git Staging view if it's empty every time a refresh happens on the repository and a task is active.

    Edit: For programmatic access, have a look at the org.eclipe.mylyn.tasks.ui plug-in. The class TasksUi serves as an entry point, giving you access to all high-level task API classes. What you are looking for is found in ITaskActivityManager:

       ITaskActivityManager activityManager = TasksUi.getTaskActivityManager();
       ITask activeTask = activityManager.getActiveTask();