[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: Window closing event in compare editor

Hi,

Well I figured it out :-) You need to implement IPartListener and register 
the listener using the addPartListener() method in IWorkbenchPage. You can 
trap the window closing event using the partClosed() method in the listener 
and by checking to see if the call was triggered by the compare editor.

-- SNR

"Sudarshan" <sudarshan@xxxxxxxxxxxxxxxxxxxx> wrote in message 
news:cshm5r$u5u$1@xxxxxxxxxxxxxxxxxx
> Hi,
>
> I am using the Eclipse compare editor to compare two text files. To open 
> the files in the compare editor, I use CompareEditorInput to prepare the 
> input and the CompareUI.openCompareEditor(input) method to display the 
> files. I have even got the save routine working whenever the files are 
> changed. Now I want to set/reset a persistent property for the files 
> whenever the compare editor is closed by the user. However, I am not able 
> to come up with a way to trap the window closing event from the compare 
> editor. Thought this must be straightforward ... maybe I am missing 
> something here. I am invoking the openCompareEditor() method like this:
>
> window.getShell().getDisplay().syncExec(new Runnable()
> {
>        public void run()
>        {
>             CompareUI.openCompareEditor(input);
>        }
> }); // (window is the active workbench window)
>
> Any thoughts on how I might be able to trap the window closing event from 
> the compare editor ?
>
> Thanks in advance.
>
> -- SNR
>
>
>