Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Window closing event in compare editor
Window closing event in compare editor [message #449078] Tue, 18 January 2005 00:44 Go to next message
Sudarshan Raghavan is currently offline Sudarshan RaghavanFriend
Messages: 7
Registered: July 2009
Junior Member
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
Re: Window closing event in compare editor [message #449206 is a reply to message #449078] Wed, 19 January 2005 14:15 Go to previous message
Sudarshan Raghavan is currently offline Sudarshan RaghavanFriend
Messages: 7
Registered: July 2009
Junior Member
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@spectrumsoftware.net> wrote in message
news:cshm5r$u5u$1@www.eclipse.org...
> 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
>
>
>
Previous Topic:How to notify View of Editor changes
Next Topic:Swing/awt and SWT events compatibility
Goto Forum:
  


Current Time: Fri Apr 26 13:17:03 GMT 2024

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

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

Back to the top