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

Bug 357242

Summary: Ability to specify default editor for text files
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: ClientAssignee: Mark Macdonald <mamacdon>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: johnjbarton, susan
Version: 0.2   
Target Milestone: 0.4 M1   
Hardware: PC   
OS: All   
Whiteboard:

Description Mark Macdonald CLA 2011-09-09 10:39:30 EDT
Orion 0.3M2 

1. Go to the Navigator.
2. Create a file with some unrecognized extension -- for example foo.jsp
3. There is no UI for opening an editor on this file.
   The navigator simply generates a link to view the raw file contents (which is empty).

I would like to have the choice of viewing the file or editing it. I should also be able to associate it with a registered editor as a user preference.
Comment 1 John Arthorne CLA 2011-12-01 09:12:20 EST
*** Bug 365263 has been marked as a duplicate of this bug. ***
Comment 2 John Arthorne CLA 2011-12-01 09:16:23 EST
I keep hitting this too. For example *.properties and other random text files. I'm tempted to say by default we always try to open in the editor, and have another "View" or "Display" command in the Actions column.
Comment 3 Mark Macdonald CLA 2011-12-01 09:32:27 EST
*** Bug 363063 has been marked as a duplicate of this bug. ***
Comment 4 Mark Macdonald CLA 2011-12-01 09:47:04 EST
Perhaps we can allow an editor be designated as the default to fallback on if nothing better is found. The Orion editor would do this so random file types could be edited easily.

However certain types (GIF/PNG/JPG/etc) should always get the "View" action as the default unless there's some pixel editor available to actually edit them.
Comment 5 Mark Macdonald CLA 2011-12-06 12:38:15 EST
I added an "orion.navigate.openWith.default" service. An editor ID can be registered with this service, which sets it as the default to use for opening files when a more specific editor isn't found. Images are still handled as a special case in the navigator: they get a direct link and a thumbnail instead of the default editor.

Anyway, I still like the idea of having a View/Display action in the Actions menu. It would be a good way to get a raw view of a file, and it also gives you a quick hook for downloading a single file (right-click > Save Link As).
Comment 6 Mark Macdonald CLA 2011-12-06 13:44:22 EST
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=1280fc1e08f5d44573d52b07c6af110b715cfcac

Note that you'll probably have to do a localStorage.clear() after you pick up the fix, or you won't see any effect. See 365663.