Community
Participate
Working Groups
When you open an external file using File->Open File..., you cannot specify which editor should be used to edit the file.
It uses whatever editor is defined by the system for editing files of that name/content type. At least, thats what the code seems to do. If I open a Java file I dont seem to get the java editor but if I open an HTML editor I get the browser...
>If I open a Java file I dont seem to get the java editor but if I open an HTML >editor I get the browser... That would be a severe bug and a regression. I just tried it using 3.1 RC2 and it works as expected. Please file a new bug report and provide steps to reproduce since this isn't related to the bug reported in this PR.
Just tried to open a *.java file in N20050602-0010 and it works too. Adding a File > Open File With > [List of all editors] doesn't scale. The solution we should target is a file chooser that actually lets us select external *and* also files from the workspace. The context menu would contain 'Open With'. Michael, AFAIK there's no such dialog yet in Platform UI. Are there plans to do so, or are clients expected to do this? Similar dialog would be useful for the Save As... scenario, see bug 74375 for a discussion about that.
Dani : I must've been mistaken. I can indeed open .java files with the Java editor. Maybe I was trying to open a .jawa file or something. Sorry to have raised the red flag.
np. maybe you were simply confused because there's no model for such an external Java file and hence no ruler info and no Java Outline.
no I don't think we have this type of dialog now.
*** Bug 71543 has been marked as a duplicate of this bug. ***
*** Bug 160978 has been marked as a duplicate of this bug. ***
Since 'Open File...' is now owned by Platform UI, this bug should be handled on the same layer.
Is this still an issue ? I've just used it to successfully open an external '.java' file using M5.
1. read comment 0 2. try to open the Java file with e.g. the Text Editor
This would be nice...
Mass update - removing 3.4 target. This was one of the bugs I marked for investigation (and potential fixing) in 3.4 but I ran out of time. Please ping on the bug if fixing it would be really important for 3.4, and does not require API changes or feature work.
Is there something I could do to investigate and help?
I would like to see this too. I have my own editor for specific XML files but when I open .xml files using File > Open File... the standard XML editor is invoked (as opposed to opening the same file if living in the workspace). Naive question: why can't we use the same mechanisms for determining the correct editor for external files that we do for workspace files? Note that this same problem occurs for Ant files that are external, since they share the same file extension as generic *.xml files.
(In reply to comment #14) > Is there something I could do to investigate and help? Sure - the first step would be to find out if this can be fixed without API changes...
Re comment 14: I guess it should be doable without API additions but the hard part will be to find a good UI. Re comment 15: I think that's a different use case / bug: it seems that a different algorithm is used to get the default editor when opening your external file. I suggest to file this separately as this feature request is about having 'Open With'. Note that if in 3.4 M7 you define a file extension (General > Editors > File Associatiions) along with an editor then this editor will be used to open the external file i.e. duplicate bug 160978 and bug 71543 are actually fixed in 3.4 M7.
(In reply to comment #17) > Re comment 15: I think that's a different use case / bug: it seems that a > different algorithm is used to get the default editor when opening your > external file. I suggest to file this separately as this feature request is > about having 'Open With'. OK, I have opened bug 230865 for this (as a bug not an enhancement, since there should be consistent behavior in editor choice). > Note that if in 3.4 M7 you define a file extension (General > Editors > File > Associatiions) along with an editor then this editor will be used to open the > external file i.e. duplicate bug 160978 and bug 71543 are actually fixed in 3.4 > M7. This won't help my situation, since I am providing an editor for a file extension that already has a default editor (same situation as Ant, providing a specific editor for certain types of .xml files).
I think this problem is made worse by the fact that proper content type analysis (checking the actual contents of the file store) isn't being done. The patch in https://bugs.eclipse.org/bugs/show_bug.cgi?id=230865 helps with that... One approach Dani and I discussed was to augment the "New Editor" action on the tab of the opened editor so you can open any appropriate editor not just a duplicate of the existing editor. Then if you opened a file and the desired type of editor didn't open, you'd at least be able to open it this way...
I think, the most intuitive solution would be a drop down option for the open button in the file selection dialog (of File > Open File...). Several other software uses this solution in similar use cases. If a user selects this option, the same dialog like for workbench file will be shown to choose the editor to open. I know the SWT filedialog doesn't support it at moment, but perhaps this could be added in the next version?
(In reply to comment #19) > One approach Dani and I discussed was to augment the "New Editor" action on the > tab of the opened editor so you can open any appropriate editor not just a > duplicate of the existing editor. Then if you opened a file and the desired > type of editor didn't open, you'd at least be able to open it this way... This looks like feature work to me, which we were asked today by our PMC to not do at this point in the cycle. If you include the file in question in your workspace as a linked file (or inside a linked folder), can you get it to open with any editor? I know that this is not a very good workaround, but it might be worth a try.
I can't imagine a way for the file dialog to be extensible that's workable across multiple platforms. Also consider that the selection dialog lets you select multiple files and so it gets even worse to chose one editor for many files.
With bug 230865 being fixed now, people get the same editor when opening an external file as they get when opening the file from the workspace. I suggest to defer this bug to 3.5 as a good solution will need some discussion, e.g. whether it's OK to add actions like this to the editor tab.
Dani, I agree. I think getting the same behavior for open was the worst aspect of this shortcoming so having fixed that, the need for changes is significantly reduced.
(In reply to comment #19) > One approach Dani and I discussed was to augment the "New Editor" action on the > tab of the opened editor so you can open any appropriate editor not just a > duplicate of the existing editor. Then if you opened a file and the desired > type of editor didn't open, you'd at least be able to open it this way... Bug 69681 is similar to this.
Remy is now responsible for watching the [EditorMgmt] component area.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.