Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Saving file when tab is changed!
Saving file when tab is changed! [message #772742] Fri, 30 December 2011 13:33 Go to next message
Snakebyte Missing name is currently offline Snakebyte Missing nameFriend
Messages: 130
Registered: November 2011
Senior Member
Hello

i got a question about saving changes in the current editor.
Is it in any way possible to add a listener to eclipse that is called when the current editor is switched ?

The reason is, that i want to save a file everytime when the current working tab (editor) is changed.
How can i do that ?
Re: Saving file when tab is changed! [message #778511 is a reply to message #772742] Thu, 12 January 2012 23:54 Go to previous messageGo to next message
Snakebyte Missing name is currently offline Snakebyte Missing nameFriend
Messages: 130
Registered: November 2011
Senior Member
Now more suggestions on this ?
Im really new to plugin development.
Re: Saving file when tab is changed! [message #778557 is a reply to message #772742] Fri, 13 January 2012 09:26 Go to previous messageGo to next message
Eclipse UserFriend
You can use an IPartListener for that.


On 30/12/11 14:33, Snakebyte Mising name wrote:
> Hello
>
> i got a question about saving changes in the current editor.
> Is it in any way possible to add a listener to eclipse that is called
> when the current editor is switched ?
>
> The reason is, that i want to save a file everytime when the current
> working tab (editor) is changed.
> How can i do that ?
Re: Saving file when tab is changed! [message #781974 is a reply to message #772742] Sun, 22 January 2012 22:05 Go to previous message
Kitesurfer () is currently offline Kitesurfer ()Friend
Messages: 87
Registered: December 2009
Member
Perhaps you can handle it with the getAdapter method of the editor. It get's called a number of times when you change tab's (last time with class org.eclipse.ui.part.IShowInSource). Loop through the open editors, and save every editor that's dirty (should always be zero or one in your case).
Previous Topic:Outline view
Next Topic:How to obtain a progress monitor w/o a Job?
Goto Forum:
  


Current Time: Wed Aug 17 17:06:13 GMT 2022

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

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

Back to the top