Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsListening for editor close events via IWorkbenchWindow.addPerspectiveListener and addPageListener
https://www.eclipse.org/forums/index.php/mv/msg/414278/957052/#msg_957052
(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?]]>Tony2012-10-25T01:02:47-00:00Re: Listening for editor close events via IWorkbenchWindow.addPerspectiveListener and addPageListene
https://www.eclipse.org/forums/index.php/mv/msg/414278/957501/#msg_957501
> 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]]>Dani Megert2012-10-25T09:12:01-00:00Re: Listening for editor close events via IWorkbenchWindow.addPerspectiveListener and addPageListene
https://www.eclipse.org/forums/index.php/mv/msg/414278/958015/#msg_958015
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.