OpenExternalFileAction doesn't handle new files so I want to override [message #541235] |
Fri, 18 June 2010 16:07  |
Eclipse User |
|
|
|
The Open file... action that I got for free in my RCP editor (i.e. I didn't specify an open action and one just showed up) doesn't handle creating new files. It gives an error instead.
IMO, this is lacking and such functionality should be basic or at the very least optional behaviour (i.e. think of how many times you have created files via an editor).
According to some forum posts, the action code being added is: org.eclipse.ui.internal.editors.text.OpenExternalFileAction. java which I found the source for on the web. From that source, I don't see a way of altering the behaviour via an option so I will have to create my own OpenFile action.
How do I properly override so the OpenExternalFileAction doesn't also show up?
[Updated on: Fri, 18 June 2010 18:37] by Moderator
|
|
|
|
Re: Free Openfile Action doesn't handle new files so I want to override [message #541584 is a reply to message #541267] |
Mon, 21 June 2010 11:53  |
Eclipse User |
|
|
|
>Jeff Johnston wrote:
>> The Open file... action that I got for free in my RCP editor (i.e. I
>> didn't specify an open action and one just showed up) doesn't handle
>> creating new files. It gives an error instead.
>What exactly do you want to achieve?
>
>Dani
I want to create a file if it does not exist or else open an existing file, much the same as one would do from the command line. e.g. vi new.file or vi existing.file The editor just handles it.
My RCP editor handles new files or existing files, specified on the command line,,the same way. It realizes the file doesn't exist and so just creates it since the user specified it.
I expected the defaulted Open file action to have the same behaviour, but it appears I am wrong. Looking at emacs and gedit for examples, both of them have a separate New file action vs Open existing file. gedit allows new file names to be specified on the command line and opens the new file, but it doesn't allow new file names in the Open File dialog. I guess I never noticed this before because I typically open new files via vi on the command line and only use emacs for existing files.
So, the result is that I now realize the defaulted Open file action is doing what it is supposed to do and there is a New file action missing.
|
|
|
Powered by
FUDForum. Page generated in 0.06905 seconds