Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » [Compare Editor] DiffViewer doesn't refresh with custom CompareEditorInput
[Compare Editor] DiffViewer doesn't refresh with custom CompareEditorInput [message #335212] Thu, 26 March 2009 03:21 Go to next message
Shankar is currently offline ShankarFriend
Messages: 3
Registered: July 2009
Junior Member
Hello,

I need to provide a custom CompareEditorInput to the compare editor. I
created left and right inputs that implements ITypedElement,
IStreamContentAccessor and IEditableContent. In the prepareInput method of
the custom CompareEditorInput, these left and right inputs are used as
left and right sides of a DiffNode. I am able to successfully open the
editor. However, the diff viewer in the compare editor doesn't refresh
(doesn't show the differences) when changes are made in the editor.

I looked at the source code and I believe the reason is due to the
contents not being flushed to the input elements via the content provider
in ContentMergeViewer. This is due to the instanceof check done for the
diff node. The check is made against ResourceCompareInput.MyDiffNode in
the saveLeftContent and saveRightContent methods in
MergeViewerContentProvider and the fireChange method is never called.

fireChange is never called from saveLeftContent method saveRightContent
methods in MergeViewerContentProvider due to below instanceof check
if (node instanceof ResourceCompareInput.MyDiffNode)
((ResourceCompareInput.MyDiffNode)node).fireChange();

What is the best way to get around this issue? Is there a way I can
contribute my own provider?

Any help is greatly appreciated.
Re: [Compare Editor] DiffViewer doesn't refresh with custom CompareEditorInput [message #335428 is a reply to message #335212] Wed, 08 April 2009 05:51 Go to previous messageGo to next message
Shankar is currently offline ShankarFriend
Messages: 3
Registered: July 2009
Junior Member
Would appreciate any help on the below. Am really stuck - the diff viewer
in the compare editor doesn't refresh due to the instanceof check
(hard-coded to ResourceCompareInput.MyDiffNode). However, I provide my own
compare input. Any thoughts please?

Shankar wrote:

> Hello,

> I need to provide a custom CompareEditorInput to the compare editor. I
> created left and right inputs that implements ITypedElement,
> IStreamContentAccessor and IEditableContent. In the prepareInput method of
> the custom CompareEditorInput, these left and right inputs are used as
> left and right sides of a DiffNode. I am able to successfully open the
> editor. However, the diff viewer in the compare editor doesn't refresh
> (doesn't show the differences) when changes are made in the editor.

> I looked at the source code and I believe the reason is due to the
> contents not being flushed to the input elements via the content provider
> in ContentMergeViewer. This is due to the instanceof check done for the
> diff node. The check is made against ResourceCompareInput.MyDiffNode in
> the saveLeftContent and saveRightContent methods in
> MergeViewerContentProvider and the fireChange method is never called.

> fireChange is never called from saveLeftContent method saveRightContent
> methods in MergeViewerContentProvider due to below instanceof check
> if (node instanceof ResourceCompareInput.MyDiffNode)
> ((ResourceCompareInput.MyDiffNode)node).fireChange();

> What is the best way to get around this issue? Is there a way I can
> contribute my own provider?

> Any help is greatly appreciated.
Re: [Compare Editor] DiffViewer doesn't refresh with custom CompareEditorInput [message #335440 is a reply to message #335428] Wed, 08 April 2009 13:38 Go to previous messageGo to next message
Michael Valenta is currently offline Michael ValentaFriend
Messages: 35
Registered: July 2009
Member
Shankar,

I don't believe that the compare framework supports "live" difference
update when changes are made in an editor. I believe you need to save
the editor to have the diff recomputed. I seem to recall that there were
already bugs entered for this so you may want to search in bugzilla.

In regards to the hard-coded reference to
ResourceCompareInput.MyDiffNode, I belivee this is a hack to make the
Compare with/Each Other work when performed on folders. There are
already bugs for that as well.

Michael

Shankar wrote:
> Would appreciate any help on the below. Am really stuck - the diff
> viewer in the compare editor doesn't refresh due to the instanceof check
> (hard-coded to ResourceCompareInput.MyDiffNode). However, I provide my
> own compare input. Any thoughts please?
>
> Shankar wrote:
>
>> Hello,
>
>> I need to provide a custom CompareEditorInput to the compare editor. I
>> created left and right inputs that implements ITypedElement,
>> IStreamContentAccessor and IEditableContent. In the prepareInput
>> method of the custom CompareEditorInput, these left and right inputs
>> are used as left and right sides of a DiffNode. I am able to
>> successfully open the editor. However, the diff viewer in the compare
>> editor doesn't refresh (doesn't show the differences) when changes are
>> made in the editor.
>
>> I looked at the source code and I believe the reason is due to the
>> contents not being flushed to the input elements via the content
>> provider in ContentMergeViewer. This is due to the instanceof check
>> done for the diff node. The check is made against
>> ResourceCompareInput.MyDiffNode in the saveLeftContent and
>> saveRightContent methods in MergeViewerContentProvider and the
>> fireChange method is never called.
>
>> fireChange is never called from saveLeftContent method
>> saveRightContent methods in MergeViewerContentProvider due to below
>> instanceof check
>> if (node instanceof ResourceCompareInput.MyDiffNode)
>> ((ResourceCompareInput.MyDiffNode)node).fireChange();
>
>> What is the best way to get around this issue? Is there a way I can
>> contribute my own provider?
>
>> Any help is greatly appreciated.
>
>
Re: [Compare Editor] DiffViewer doesn't refresh with custom CompareEditorInput [message #335451 is a reply to message #335440] Wed, 08 April 2009 23:51 Go to previous messageGo to next message
Shankar is currently offline ShankarFriend
Messages: 3
Registered: July 2009
Junior Member
Thanks for the prompt response, Michael. It seems like a common use case
to be able to invoke the eclipse compare editor programmatically (from a
custom plug-in) and make changes to the compare editor. Is there any way I
can realize the live difference update in the compare editor?

Can you please let me know when this feature would be available? Please
note that I am using Eclipse 3.3.

Michael Valenta wrote:

> Shankar,

> I don't believe that the compare framework supports "live" difference
> update when changes are made in an editor. I believe you need to save
> the editor to have the diff recomputed. I seem to recall that there were
> already bugs entered for this so you may want to search in bugzilla.

> In regards to the hard-coded reference to
> ResourceCompareInput.MyDiffNode, I belivee this is a hack to make the
> Compare with/Each Other work when performed on folders. There are
> already bugs for that as well.

> Michael

> Shankar wrote:
>> Would appreciate any help on the below. Am really stuck - the diff
>> viewer in the compare editor doesn't refresh due to the instanceof check
>> (hard-coded to ResourceCompareInput.MyDiffNode). However, I provide my
>> own compare input. Any thoughts please?
>>
>> Shankar wrote:
>>
>>> Hello,
>>
>>> I need to provide a custom CompareEditorInput to the compare editor. I
>>> created left and right inputs that implements ITypedElement,
>>> IStreamContentAccessor and IEditableContent. In the prepareInput
>>> method of the custom CompareEditorInput, these left and right inputs
>>> are used as left and right sides of a DiffNode. I am able to
>>> successfully open the editor. However, the diff viewer in the compare
>>> editor doesn't refresh (doesn't show the differences) when changes are
>>> made in the editor.
>>
>>> I looked at the source code and I believe the reason is due to the
>>> contents not being flushed to the input elements via the content
>>> provider in ContentMergeViewer. This is due to the instanceof check
>>> done for the diff node. The check is made against
>>> ResourceCompareInput.MyDiffNode in the saveLeftContent and
>>> saveRightContent methods in MergeViewerContentProvider and the
>>> fireChange method is never called.
>>
>>> fireChange is never called from saveLeftContent method
>>> saveRightContent methods in MergeViewerContentProvider due to below
>>> instanceof check
>>> if (node instanceof ResourceCompareInput.MyDiffNode)
>>> ((ResourceCompareInput.MyDiffNode)node).fireChange();
>>
>>> What is the best way to get around this issue? Is there a way I can
>>> contribute my own provider?
>>
>>> Any help is greatly appreciated.
>>
>>
Re: [Compare Editor] DiffViewer doesn't refresh with custom CompareEditorInput [message #335463 is a reply to message #335451] Thu, 09 April 2009 13:08 Go to previous message
Michael Valenta is currently offline Michael ValentaFriend
Messages: 35
Registered: July 2009
Member
Shankar,

I am no longer involved in the maintenance of the Compare framework so I
cannot make any statements about when features may be available. Also, I
do not know of any way currently for you to realize live updates. The
best way to get a response from the Compare developers would be to open
a bug report.

Michael

Shankar wrote:
> Thanks for the prompt response, Michael. It seems like a common use case
> to be able to invoke the eclipse compare editor programmatically (from a
> custom plug-in) and make changes to the compare editor. Is there any way
> I can realize the live difference update in the compare editor?
> Can you please let me know when this feature would be available? Please
> note that I am using Eclipse 3.3.
>
> Michael Valenta wrote:
>
>> Shankar,
>
>> I don't believe that the compare framework supports "live" difference
>> update when changes are made in an editor. I believe you need to save
>> the editor to have the diff recomputed. I seem to recall that there
>> were already bugs entered for this so you may want to search in bugzilla.
>
>> In regards to the hard-coded reference to
>> ResourceCompareInput.MyDiffNode, I belivee this is a hack to make the
>> Compare with/Each Other work when performed on folders. There are
>> already bugs for that as well.
>
>> Michael
>
>> Shankar wrote:
>>> Would appreciate any help on the below. Am really stuck - the diff
>>> viewer in the compare editor doesn't refresh due to the instanceof
>>> check (hard-coded to ResourceCompareInput.MyDiffNode). However, I
>>> provide my own compare input. Any thoughts please?
>>>
>>> Shankar wrote:
>>>
>>>> Hello,
>>>
>>>> I need to provide a custom CompareEditorInput to the compare editor.
>>>> I created left and right inputs that implements ITypedElement,
>>>> IStreamContentAccessor and IEditableContent. In the prepareInput
>>>> method of the custom CompareEditorInput, these left and right inputs
>>>> are used as left and right sides of a DiffNode. I am able to
>>>> successfully open the editor. However, the diff viewer in the
>>>> compare editor doesn't refresh (doesn't show the differences) when
>>>> changes are made in the editor.
>>>
>>>> I looked at the source code and I believe the reason is due to the
>>>> contents not being flushed to the input elements via the content
>>>> provider in ContentMergeViewer. This is due to the instanceof check
>>>> done for the diff node. The check is made against
>>>> ResourceCompareInput.MyDiffNode in the saveLeftContent and
>>>> saveRightContent methods in MergeViewerContentProvider and the
>>>> fireChange method is never called.
>>>
>>>> fireChange is never called from saveLeftContent method
>>>> saveRightContent methods in MergeViewerContentProvider due to below
>>>> instanceof check
>>>> if (node instanceof ResourceCompareInput.MyDiffNode)
>>>> ((ResourceCompareInput.MyDiffNode)node).fireChange();
>>>
>>>> What is the best way to get around this issue? Is there a way I can
>>>> contribute my own provider?
>>>
>>>> Any help is greatly appreciated.
>>>
>>>
>
>
Previous Topic:Combining plugin projects and regular Java projects -- need best practices
Next Topic:Invoke/Load/Launch a particular version of the plugin programatically/dynamicall
Goto Forum:
  


Current Time: Fri Apr 19 20:35:10 GMT 2024

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

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

Back to the top