Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » React on Save(No File, Document loaded from Database)
React on Save [message #651662] Tue, 01 February 2011 07:50 Go to next message
Alexander Mack is currently offline Alexander MackFriend
Messages: 100
Registered: July 2009
Senior Member
Hello,
I need a Listener on document changes. I know that there is a ResourceChangeListener or a builder for things like that.
The problem is, that my documents are no physical files in the workspace. Every document is loaded from a database. So the changes of a document are not recognized by those listeners and builders.
The question is, how can I solve this?

Maybe I can use a listener on the save event itself?

Thanks in advance & best regards
Alex
Re: React on Save [message #651670 is a reply to message #651662] Tue, 01 February 2011 08:10 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
I'm not sure if the Save/Save All has been ported to the
Commands-Framework. If yes you could install a listener on the command.

Tom

Am 01.02.11 08:50, schrieb Alexander Mack:
> Hello,
> I need a Listener on document changes. I know that there is a
> ResourceChangeListener or a builder for things like that.
> The problem is, that my documents are no physical files in the
> workspace. Every document is loaded from a database. So the changes of a
> document are not recognized by those listeners and builders.
> The question is, how can I solve this?
>
> Maybe I can use a listener on the save event itself?
>
> Thanks in advance & best regards
> Alex
Re: React on Save [message #651671 is a reply to message #651662] Tue, 01 February 2011 08:12 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
On 01.02.2011 08:50, Alexander Mack wrote:
> Hello,
> I need a Listener on document changes. I know that there is a
> ResourceChangeListener or a builder for things like that.
> The problem is, that my documents are no physical files in the
> workspace. Every document is loaded from a database. So the changes of
> a document are not recognized by those listeners and builders.
> The question is, how can I solve this?
>
> Maybe I can use a listener on the save event itself?
It depends on which layer you need to know about 'save' and whether you
own that code (e.g. your own editor). The best approach would be to
write an EFS that backs your DB. That way Eclipse could handle your DB
document ike a 'file'.

Dani
>
> Thanks in advance & best regards
> Alex
Re: React on Save [message #651685 is a reply to message #651662] Tue, 01 February 2011 09:44 Go to previous messageGo to next message
Alexander Mack is currently offline Alexander MackFriend
Messages: 100
Registered: July 2009
Senior Member
Hello and first of all: Thanks for your answers!

I own the editor, its written with GEF and I have access to the code.
Could you please expleain EFS, I've never heard or read about a way to tell eclipse that there are files in a database...
I need just a way to indicate that a document has changed. No matter if its via Save-Event or ResourceListener and so on...

Thanks
Re: React on Save [message #651687 is a reply to message #651685] Tue, 01 February 2011 09:51 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Are now interested in the event that the document changed or do you have
to find out that it gets saved?

I have no idea of GEF but I guess it is extending the EditorPart and
hence you can overload the general save method. To check for dirty ness
you can consult the EditorPart#isDirty and for modifications you can
install a Listener on the EditorPart and listen if the dirty property
has been modified.

Tom

Am 01.02.11 10:44, schrieb Alexander Mack:
> Hello and first of all: Thanks for your answers!
>
> I own the editor, its written with GEF and I have access to the code.
> Could you please expleain EFS, I've never heard or read about a way to
> tell eclipse that there are files in a database...
> I need just a way to indicate that a document has changed. No matter if
> its via Save-Event or ResourceListener and so on...
>
> Thanks
Re: React on Save [message #651700 is a reply to message #651685] Tue, 01 February 2011 10:46 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
On 01.02.2011 10:44, Alexander Mack wrote:
> Hello and first of all: Thanks for your answers!
>
> I own the editor, its written with GEF and I have access to the code.
Then you could simply extend
org.eclipse.ui.part.EditorPart.doSave(IProgressMonitor).
> Could you please expleain EFS, I've never heard or read about a way to
> tell eclipse that there are files in a database...
http://wiki.eclipse.org/index.php/EFS

Dani
> I need just a way to indicate that a document has changed. No matter
> if its via Save-Event or ResourceListener and so on...
>
> Thanks
Re: React on Save [message #651706 is a reply to message #651662] Tue, 01 February 2011 11:16 Go to previous message
Alexander Mack is currently offline Alexander MackFriend
Messages: 100
Registered: July 2009
Senior Member
Hi and thanks for your answers.

My description of the problem was not explained very properly.
I want to react on saves but outside of the plugin.
Which means I want a sort of a listener reacting to changes on my document in an external plugin

I know that I can overwirte the doSave Method in the Editor, but I need the implementation outside of the plugin as an "independent plugin"

[Updated on: Tue, 01 February 2011 11:17]

Report message to a moderator

Previous Topic:Eclipse plugins for remote resources?
Next Topic:Initial Perspectives Bar configuration and appearance
Goto Forum:
  


Current Time: Fri Apr 19 23:36:01 GMT 2024

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

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

Back to the top