How to find the updated buffer in Compare Editor? [message #328631] |
Wed, 28 May 2008 23:13  |
Eclipse User |
|
|
|
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 09:31  |
Eclipse User |
|
|
|
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.
>
|
|
|
Powered by
FUDForum. Page generated in 0.02558 seconds