Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » OpenExternalFileAction doesn't handle new files so I want to override
OpenExternalFileAction doesn't handle new files so I want to override [message #541235] Fri, 18 June 2010 20:07 Go to next message
Jeff Johnston is currently offline Jeff JohnstonFriend
Messages: 215
Registered: July 2009
Senior Member
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 22:37]

Report message to a moderator

Re: Free Openfile Action doesn't handle new files so I want to override [message #541267 is a reply to message #541235] Sat, 19 June 2010 07:46 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
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
>
> To me 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 free action doesn't also show up?
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 15:53 Go to previous message
Jeff Johnston is currently offline Jeff JohnstonFriend
Messages: 215
Registered: July 2009
Senior Member
>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.
Previous Topic:Re: Exported RCP tutorial crashes when run
Next Topic:Problem with RCP perspective layout
Goto Forum:
  


Current Time: Wed Apr 24 14:55:59 GMT 2024

Powered by FUDForum. Page generated in 0.03950 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top