Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Listening for editor close events via IWorkbenchWindow.addPerspectiveListener and addPageListener
Listening for editor close events via IWorkbenchWindow.addPerspectiveListener and addPageListener [message #957052] Thu, 25 October 2012 01:02 Go to next message
Tony is currently offline Tony
Messages: 52
Registered: July 2009
Member
I am currently migrating an application from Eclipse Helios to Eclipse Juno
(Build id: 20120620-1657) and have encountered an issue that I need help
with. Under Helios adding an anonymous implementation of
IPerspectiveListener and IPageListener to the IWorkbenchWindow returned from
the IWorkbenchWindowConfigurer.getWindow( ) was sufficient to be able to
detect that an editor was closed via the
IPerspectiveListener.perspectiveChanged method. Also, adding an anonymous
implementation of IPageListener to the IWorkbenchWindow returned was
sufficient to be able to detect that the application window has been closed
via the IPageListener.pageClosed method. However under Eclipse Juno this
functionality seems to be broken or may have been replaced by other
mechanisms. Note that under Eclipse Juno the
IPerspectiveListener.perspectiveChanged method is still invoked upon opening
an editor. Does anyone know the correct way under Eclipse Juno to both
detect that an editor has closed, and that an application is in the process
of closing?
Re: Listening for editor close events via IWorkbenchWindow.addPerspectiveListener and addPageListene [message #957501 is a reply to message #957052] Thu, 25 October 2012 09:12 Go to previous messageGo to next message
Dani Megert is currently offline Dani Megert
Messages: 3801
Registered: July 2009
Senior Member
On 25.10.2012 03:02, Tony wrote:
> I am currently migrating an application from Eclipse Helios to Eclipse Juno
> (Build id: 20120620-1657) and have encountered an issue that I need help
> with. Under Helios adding an anonymous implementation of
> IPerspectiveListener and IPageListener to the IWorkbenchWindow returned from
> the IWorkbenchWindowConfigurer.getWindow( ) was sufficient to be able to
> detect that an editor was closed via the
> IPerspectiveListener.perspectiveChanged method. Also, adding an anonymous
> implementation of IPageListener to the IWorkbenchWindow returned was
> sufficient to be able to detect that the application window has been closed
> via the IPageListener.pageClosed method. However under Eclipse Juno this
> functionality seems to be broken or may have been replaced by other
> mechanisms. Note that under Eclipse Juno the
> IPerspectiveListener.perspectiveChanged method is still invoked upon opening
> an editor. Does anyone know the correct way under Eclipse Juno to both
> detect that an editor has closed, and that an application is in the process
> of closing?
>
This looks like a bug in Juno.

Dani
Re: Listening for editor close events via IWorkbenchWindow.addPerspectiveListener and addPageListene [message #958015 is a reply to message #957501] Thu, 25 October 2012 17:30 Go to previous message
Tony is currently offline Tony
Messages: 52
Registered: July 2009
Member
"Daniel Megert" <daniel_megert@xxxxxxxx.com> wrote in message
news:k6avp2$sn6$1@xxxxxxxxe.org...
> On 25.10.2012 03:02, Tony wrote:
>> I am currently migrating an application from Eclipse Helios to Eclipse
>> Juno
>> (Build id: 20120620-1657) and have encountered an issue that I need help
>> with. Under Helios adding an anonymous implementation of
>> IPerspectiveListener and IPageListener to the IWorkbenchWindow returned
>> from
>> the IWorkbenchWindowConfigurer.getWindow( ) was sufficient to be able to
>> detect that an editor was closed via the
>> IPerspectiveListener.perspectiveChanged method. Also, adding an
>> anonymous
>> implementation of IPageListener to the IWorkbenchWindow returned was
>> sufficient to be able to detect that the application window has been
>> closed
>> via the IPageListener.pageClosed method. However under Eclipse Juno this
>> functionality seems to be broken or may have been replaced by other
>> mechanisms. Note that under Eclipse Juno the
>> IPerspectiveListener.perspectiveChanged method is still invoked upon
>> opening
>> an editor. Does anyone know the correct way under Eclipse Juno to both
>> detect that an editor has closed, and that an application is in the
>> process
>> of closing?
>>
> This looks like a bug in Juno.
>
> Dani

Regarding detecting that the application is closing, the
IPageListener.pageClosed method is invoked when my application's file menu
Exit option is selected but not when the window 'X' button is used. I was
able to use the WorkbenchWindowAdvisor.preWindowShellClose( ) method to
detect that the application was closed via the 'X' button. I'm still
looking for a solution to detect (via the WorkbenchWindow or in some similar
fashion) that an editor was closed.

Tony
Previous Topic:Incorrect Intro/Welcome behavior after move to 4.2
Next Topic:[fixed]CVS Team Provider Encoding
Goto Forum:
  


Current Time: Wed Oct 22 21:58:05 GMT 2014

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

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