Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 338371

Summary: [api] provide extensibility to customize behavior when opening tasks
Product: z_Archived Reporter: Evgeny Avtsin <ewa>
Component: MylynAssignee: Project Inbox <mylyn-triaged>
Status: CLOSED MOVED QA Contact:
Severity: enhancement    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Evgeny Avtsin CLA 2011-02-28 03:51:31 EST
Build Identifier: Version: 3.6.1 Build id: M20100909-0800

A double click on the selected item should open the task in web-browser instead of the native GUI.

The user connector performs most operations on the tasks in web-browser. 
Thus, "New" and "Delete" actions should not be available in the task action menu.

The first issue is critical, any workaround would be greatly appreciated. 

Reproducible: Always

Steps to Reproduce:
1. Open TaskList View
2. Select the task -> Task is opened in native UI and the developer cannot change it.
Comment 1 Steffen Pingel CLA 2011-03-01 00:03:19 EST
Have you tried changing the Task Editing setting to Web Browser under Tasks in the Eclipse preferences?
Comment 2 Evgeny Avtsin CLA 2011-03-01 18:07:29 EST
Hi Steffen,

The first item is resolved - thank you for quick response!

Thanks,
  Evgeny
Comment 3 Steffen Pingel CLA 2011-03-01 19:14:30 EST
New and Delete should be available in the task list context menu. What exactly are you missing and which type of repository are you connecting to?
Comment 4 Evgeny Avtsin CLA 2011-03-03 09:00:08 EST
I've received feedback from the customers: they will want to have their Bugzilla tasks still in Eclipse but their PTC tasks in a browser...

The connector retrieves task list from the server.
The tasks should be opened in web-browser on double click. 
Native Mylyn task UI is not used at all as well tasks cannot be created or deleted in Eclipse.
Comment 5 Steffen Pingel CLA 2011-04-03 19:57:22 EDT
Are the PTC tasks managed through a custom connector? If so, the connector should implement the corresponding APIs. I am not sure what kind of support you would need in Mylyn to resolve this?
Comment 6 Steffen Pingel CLA 2011-05-09 15:46:12 EDT
I'm marking this bug as resolved for now. Please feel free to reopen and provide additional information if you have further requests.
Comment 7 Evgeny Avtsin CLA 2011-06-15 06:18:26 EDT
I would replace the action handler for Open Task for my action via setGlobalActionHandler(). The new action should trigger the Open With Browser action for my repository tasks and the original one for the rest tasks. 

I retrieved the handler for Open Task successfully via

IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
ICommandService cmdService = (ICommandService) window.getService(
        	    ICommandService.class);


Command a = cmdService.getCommand("org.eclipse.mylyn.tasks.ui.command.openSelectedTask");
IHandler ah = a.getHandler();

But an action for Open With Browser is not registered there: I expected to see "org.eclipse.mylyn.tasklist.actions.open.browser".

How to access Open With Browser handler?
In general, is the proposed solution seems feasible? Maybe you could propose something better...
Comment 8 Steffen Pingel CLA 2011-08-11 08:03:39 EDT
There are several code paths for opening tasks. I don't think overriding command handlers will achieve what you are looking for. 

I have changed the summary of the task accordingly to provide this type of extensibility.
Comment 9 Eclipse Webmaster CLA 2022-11-15 11:45:08 EST
Mylyn has been restructured, and our issue tracking has moved to GitHub [1].

We are closing ~14K Bugzilla issues to give the new team a fresh start. If you feel that this issue is still relevant, please create a new one on GitHub.

[1] https://github.com/orgs/eclipse-mylyn