Save Action [message #332997] |
Tue, 18 November 2008 16:56  |
Eclipse User |
|
|
|
I have searched around this newsgroup and found parts of this answer but
not a complete one so I thought I would post this with some questions.
Basically my plugin has to work with a file that resides on a remote
server. I have already created the functionality in my plugin in Eclipse
so that my code goes out, downloads the file, and writes it to a temporary
folder locally, and opens a basic text editor on that newly downloaded
temporary file.
The text editor org.eclipse.ui.DefaultTextEditor saves the temporary file
right back to the same place on disk when it is opened and changed so that
is fine. The problem is that I just need to keep that functionality
*plus* write the file back to the server that I pulled it from whenever a
user selects "Save". I assume I need to override the save action on that
particular file to do this.
So, in my research I found the SaveAction class, but the javadoc says it
is not intended to be subclassed. I guess I am at a loss at how to
override the saving action as my first instinct would to be to extend that
class and just put in the extra code I need to go out and connect to the
server and do the second save.
Does anyone have an example of getting this done? I would be more than
happy to create an example if anyone can give me a few ideas as to how to
tackle this. Thanks.
Andy
|
|
|
|
|
Re: Save Action [message #333023 is a reply to message #333010] |
Wed, 19 November 2008 15:19  |
Eclipse User |
|
|
|
Andy wrote:
> From what I was looking at about EFS was that the WEBDAV support (which
> is what I would need in this case) was basically non existent, hence the
> approach I need to take with overriding a save action.
> If anyone has an example on how to override that save action that would
> be most appreciated.
>
> Andy
>
Remote System Explorer from the Target Management Project provides
exactly the functionality you described. Double-clicking a remote file
copies it to a local temp folder, opens it in the appropriate editor,
and then when you Save the file gets written to the temp folder and
copied back to the original location on the server. I set my homegrown
solution aside and just use the Remote Systems view from RSE now. You
might look at their source to see how they make it work.
-
Steve
|
|
|
Powered by
FUDForum. Page generated in 0.02823 seconds