Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Participate in all "File->Save" operations?
Participate in all "File->Save" operations? [message #282484] Mon, 14 March 2005 13:43 Go to next message
Eclipse UserFriend
I'd like to have a plugin get a chance to look at every file save
operation, even if it's coming from an editor written by someone
else. This means I can't just add code to the editor's doSave()
method.

I've found 4 places where this operation gets initiated: The
workbench File->Save menu/Save push-button, each editor's right-click
context menu Save selection, the Resource Save operation when the
file is closed from the editor window, and the Workbench save
operation when the workbench is closed while the file is open. Are
there more?

Other than the ISaveParticipant interface, I don't find any "legal"
public method for insinuating myself into the process. I've found
examples of people doing it, but they've used internal classes,
and used some dodgy techniques to get their action stuck in place of
the standard SaveActions. Also, the techniques used resulted in an
all-or-nothing implementation. If someone hijacks the SaveActions,
anybody else who tried to do the same would get lost; there's no way
to "chain" these save peekers.

Is there any legal way to do this? I've only looked in 3.0.1; is
anything changing in 3.1?

[I posted this same question a few weeks ago and didn't see any
response; I'm hoping that it was just because everybody was
distracted by EclipseCon :-)]

--
Bert Hyman | Unisys - Roseville MN
bert.hyman@unisys.com | (651) 635-7791 | net2: 524-7791
Re: Participate in all "File->Save" operations? [message #282513 is a reply to message #282484] Tue, 15 March 2005 09:13 Go to previous messageGo to next message
Eclipse UserFriend
Bert,

There is currently no mechanism for this and nothing is planned for 3.1.
However, we are looking at the issue. Any progress that is made will be
posted in bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=37723. This
bug deals with support for logical models in the Eclipse platform, of
which save participation is only one of the issues.

Michael

Bert Hyman wrote:

> I'd like to have a plugin get a chance to look at every file save
> operation, even if it's coming from an editor written by someone
> else. This means I can't just add code to the editor's doSave()
> method.
>
> I've found 4 places where this operation gets initiated: The
> workbench File->Save menu/Save push-button, each editor's right-click
> context menu Save selection, the Resource Save operation when the
> file is closed from the editor window, and the Workbench save
> operation when the workbench is closed while the file is open. Are
> there more?
>
> Other than the ISaveParticipant interface, I don't find any "legal"
> public method for insinuating myself into the process. I've found
> examples of people doing it, but they've used internal classes,
> and used some dodgy techniques to get their action stuck in place of
> the standard SaveActions. Also, the techniques used resulted in an
> all-or-nothing implementation. If someone hijacks the SaveActions,
> anybody else who tried to do the same would get lost; there's no way
> to "chain" these save peekers.
>
> Is there any legal way to do this? I've only looked in 3.0.1; is
> anything changing in 3.1?
>
> [I posted this same question a few weeks ago and didn't see any
> response; I'm hoping that it was just because everybody was
> distracted by EclipseCon :-)]
>
>
Re: Participate in all "File->Save" operations? [message #282515 is a reply to message #282513] Tue, 15 March 2005 09:20 Go to previous message
Eclipse UserFriend
In news:4236ED70.9070104@ca.ibm.com Michael Valenta
<Michael_Valenta@ca.ibm.com> wrote:

> Bert,
>
> There is currently no mechanism for this and nothing is planned for 3.1.
> However, we are looking at the issue. Any progress that is made will be
> posted in bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=37723. This
> bug deals with support for logical models in the Eclipse platform, of
> which save participation is only one of the issues.

Thanks! I'll keep track of that.

We have some ... er ... peculiar requirements for file content and format
in an IDE for our big iron and may need to massage the files on their way
down.

> Bert Hyman wrote:
>
>> I'd like to have a plugin get a chance to look at every file save
>> operation, even if it's coming from an editor written by someone
>> else. This means I can't just add code to the editor's doSave()
>> method.
>>
>> I've found 4 places where this operation gets initiated: The
>> workbench File->Save menu/Save push-button, each editor's right-click
>> context menu Save selection, the Resource Save operation when the
>> file is closed from the editor window, and the Workbench save
>> operation when the workbench is closed while the file is open. Are
>> there more?
>>
>> Other than the ISaveParticipant interface, I don't find any "legal"
>> public method for insinuating myself into the process. I've found
>> examples of people doing it, but they've used internal classes,
>> and used some dodgy techniques to get their action stuck in place of
>> the standard SaveActions. Also, the techniques used resulted in an
>> all-or-nothing implementation. If someone hijacks the SaveActions,
>> anybody else who tried to do the same would get lost; there's no way
>> to "chain" these save peekers.
>>
>> Is there any legal way to do this? I've only looked in 3.0.1; is
>> anything changing in 3.1?
>>
>> [I posted this same question a few weeks ago and didn't see any
>> response; I'm hoping that it was just because everybody was
>> distracted by EclipseCon :-)]

--
Bert Hyman St. Paul, MN bert@iphouse.com
Previous Topic:SWT action event
Next Topic:CVS Compare shows whole file as different
Goto Forum:
  


Current Time: Sat Jul 26 01:47:45 EDT 2025

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

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

Back to the top