Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Hooking into IWorkbenchPage.closeEditors
Hooking into IWorkbenchPage.closeEditors [message #499441] Sun, 22 November 2009 16:15 Go to next message
Hayden Marchant is currently offline Hayden MarchantFriend
Messages: 12
Registered: November 2009
Junior Member
I am writing an RCP application which is based on GMF. A diagram can consist of 1 or more editors. So when it is decided to close a diagram, the user clicks the 'close' button on the editor tab.

I would like to hook into that click and trigger the closure of all the 'child' editors of that editor.

I've searched up and down for the relevant extension point, listeners, etc... but came up with nothing.

Sadly, I have no sample code to attach.

Thanks,
Hayden
Re: Hooking into IWorkbenchPage.closeEditors [message #499505 is a reply to message #499441] Mon, 23 November 2009 05:51 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
Hayden Marchant wrote:
> I am writing an RCP application which is based on GMF. A diagram can
> consist of 1 or more editors. So when it is decided to close a diagram,
> the user clicks the 'close' button on the editor tab.
>
> I would like to hook into that click and trigger the closure of all the
> 'child' editors of that editor.

Look at IPartListener.partClosed()

- Prakash

Platform UI Team, IBM
http://blog.eclipse-tips.com
Re: Hooking into IWorkbenchPage.closeEditors [message #499517 is a reply to message #499505] Mon, 23 November 2009 07:44 Go to previous message
Hayden Marchant is currently offline Hayden MarchantFriend
Messages: 12
Registered: November 2009
Junior Member
I did see the IPartListener, but I'm a little concerned that the user experience might be a little strange, since I'll be plugging in my logic a little late in the process.

For example, will I be able to invoke IWorkbenchPage.closeEditors from within the callback of partClosed(). How do I create a' 'request' to close the other editors, asynchronously, so that when the UI 'has time' it will close the other editors?

btw, I would have liked it to be collated together from the beginning, so that the prompt for save can be done in one action. Now, if my main page needs saving, I'll get that prompt, and only when it's saved, will it prompt for the other pages to be saved. A slight usability glitch that I'd like to avoid if possible.

Any suggestions with both issues?
Re: Hooking into IWorkbenchPage.closeEditors [message #603499 is a reply to message #499505] Mon, 23 November 2009 07:44 Go to previous message
Hayden Marchant is currently offline Hayden MarchantFriend
Messages: 12
Registered: November 2009
Junior Member
I did see the IPartListener, but I'm a little concerned that the user experience might be a little strange, since I'll be plugging in my logic a little late in the process.

For example, will I be able to invoke IWorkbenchPage.closeEditors from within the callback of partClosed(). How do I create a' 'request' to close the other editors, asynchronously, so that when the UI 'has time' it will close the other editors?

btw, I would have liked it to be collated together from the beginning, so that the prompt for save can be done in one action. Now, if my main page needs saving, I'll get that prompt, and only when it's saved, will it prompt for the other pages to be saved. A slight usability glitch that I'd like to avoid if possible.

Any suggestions with both issues?
Previous Topic:Hooking into IWorkbenchPage.closeEditors
Next Topic:PDE build/test problem
Goto Forum:
  


Current Time: Tue Aug 04 09:13:55 GMT 2020

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

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

Back to the top