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

Bug 315722

Summary: [navigation] Add 'Open With' context menu to textual editors
Product: [Eclipse Project] Platform Reporter: Dani Megert <daniel_megert>
Component: TextAssignee: Rajesh <rthakkar>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: andre.bossert, markus.kell.r, rthakkar
Version: 3.6   
Target Milestone: 3.7 M2   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Patch for 315722
none
patch
none
Patch daniel_megert: iplog+, daniel_megert: review+

Description Dani Megert CLA 2010-06-04 03:08:08 EDT
3.6 RC4.

Since we added 'Open With' to the Compare editor's context menu I'm constantly missing it in our textual editors. We should add this.

See also bug 69681 for a more general solution.
Comment 1 Dani Megert CLA 2010-07-12 06:44:56 EDT
The menu item should appear before 'Show In'.
Comment 2 Rajesh CLA 2010-08-19 17:26:37 EDT
Created attachment 177052 [details]
Patch for 315722
Comment 3 Dani Megert CLA 2010-08-20 06:07:46 EDT
Thanks for the patch Rajesh! Except for a missing mnemonic it looks good.

However, we have to do something about the cases where the 'Open With' menu has no entries: I don't like to have a menu entry which grays out when I select it. What would you recommend to fix this?
Comment 4 Rajesh CLA 2010-08-20 11:14:44 EDT
(In reply to comment #3)
> Thanks for the patch Rajesh! Except for a missing mnemonic it looks good.
> 
> However, we have to do something about the cases where the 'Open With' menu has
> no entries: I don't like to have a menu entry which grays out when I select it.
> What would you recommend to fix this?

I did think about this earlier because even for files that are not in the workspace the menu disappears on hover. It would make sense for the menu to be grey on display if it does not have entries. Also, I don't see why for external files of defined type, it wouldn't have any entries.
Will look into this.
Comment 5 Dani Megert CLA 2010-08-23 04:45:57 EDT
>It would make sense for the menu to be
>grey on display if it does not have entries.
Nope. The context menu should be as context-sensitive as possible except there are performance issues which prevent us from doing the checks each time. Which means, if can do checks do mark it gray, we can directly omit the menu item.

In our case the check is cheap: the logic used in the OpenWithAction is:
    org.eclipse.ui.actions.OpenWithMenu.getFileResource() != null
==> we can copy that code and do the same check.
Comment 6 Rajesh CLA 2010-08-23 06:45:49 EDT
Created attachment 177201 [details]
patch

(In reply to comment #5)
> >It would make sense for the menu to be
> >grey on display if it does not have entries.
> Nope. The context menu should be as context-sensitive as possible except there
> are performance issues which prevent us from doing the checks each time. Which
> means, if can do checks do mark it gray, we can directly omit the menu item.
> 
> In our case the check is cheap: the logic used in the OpenWithAction is:
>     org.eclipse.ui.actions.OpenWithMenu.getFileResource() != null
> ==> we can copy that code and do the same check.

Done.
Comment 7 Rajesh CLA 2010-08-23 09:52:40 EDT
Created attachment 177217 [details]
Patch

Changed mnemonic to 'i' and changed order in which 'open with' and 'show it' are added.
Comment 8 Dani Megert CLA 2010-08-24 05:47:59 EDT
Thansk again.
Fixed in HEAD.
Available in builds >= I20100824-0800.
Comment 9 Dani Megert CLA 2010-09-14 07:39:58 EDT
Verified in I20100914-0100.
Comment 10 Dani Megert CLA 2014-02-13 08:13:20 EST
*** Bug 281830 has been marked as a duplicate of this bug. ***