Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to find the updated buffer in Compare Editor?
How to find the updated buffer in Compare Editor? [message #328631] Thu, 29 May 2008 03:13 Go to next message
Eclipse UserFriend
Originally posted by: bkwok.sympatico.ca

This is an Eclipse newbie question.
We have a plugin which uses CompareEditorInput to compare 2 XSL files. The
left pane is editable. When I click SAVE button or press CTRL+S after
merge operation, my saveChanges method is invoked. However I am having a
hard time to find out the updated information showing in left pane. I need
to update one of the XSL file with merged data. I have tried to borrow the
logic from ResourceCompareInput.java without success. The XSL file is
updated with old information (before merge).

I am running Eclipse 3.3.2. There is a new class
SaveableCompareEditorInput.
Because I need to keep the existing CompareUI code, it is not clear to me
how to incorporate SaveableCompareEditorInput into my existing program.

I welcome any suggestion, pointer, sample code.

Many thanks in advance.
Re: How to find the updated buffer in Compare Editor? [message #328641 is a reply to message #328631] Thu, 29 May 2008 13:31 Go to previous message
Michael Valenta is currently offline Michael ValentaFriend
Messages: 35
Registered: July 2009
Member
Barney,

The save mechanics in the compare editor are a bit complicated. The
default saveChanges method first flushes the viewers and then performs a
save. If you override saveChanges, you would still want to flush the
viewers before performing your save. What the flushViewers does is tell
the viewers (in your case the left pane) to push any modifed content
into the input node that was returned from the
CompareEditorInput#prepareInput method.

If your left pane is an IFile, you may want to consider using a subclass
of SavableCompareEditorInput. The best source of information on this is
the ISV doc that ships with Eclipse and there was also an EclipseCon
talk a few years ago which can be found at
http://www.eclipsecon.org/2007/index.php?page=sub/&id=37 82

Hope this helps,
Michael

Barney Kwok wrote:
> This is an Eclipse newbie question.
> We have a plugin which uses CompareEditorInput to compare 2 XSL files.
> The left pane is editable. When I click SAVE button or press CTRL+S
> after merge operation, my saveChanges method is invoked. However I am
> having a hard time to find out the updated information showing in left
> pane. I need to update one of the XSL file with merged data. I have
> tried to borrow the logic from ResourceCompareInput.java without
> success. The XSL file is updated with old information (before merge).
>
> I am running Eclipse 3.3.2. There is a new class
> SaveableCompareEditorInput.
> Because I need to keep the existing CompareUI code, it is not clear to
> me how to incorporate SaveableCompareEditorInput into my existing program.
>
> I welcome any suggestion, pointer, sample code.
>
> Many thanks in advance.
>
Previous Topic:RC1 hanging on software update
Next Topic:Refresh resource after external alteration to file
Goto Forum:
  


Current Time: Wed Jul 03 17:27:02 GMT 2024

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

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

Back to the top