Side by side compare of text [message #317476] |
Wed, 04 July 2007 09:12  |
Eclipse User |
|
|
|
Originally posted by: johan.piculell.ericsson.com
Hi.
I was about to fix a side-by-side compare view of two strings representing
text documents, i.e. compare two text document that are in memory and does
not reside in any IResource.
But now I'm kind of lost in CompareUI, TextMergeViewer,
EditionSelectionDialog, etc.
Is there a smooth way of dealing with this or do I have to write my own
CompareEditorInput based on java strings...
I would really need a push in the right direction here
thanks
/Johan
|
|
|
|
Re: Side by side compare of text [message #317520 is a reply to message #317515] |
Thu, 05 July 2007 14:55  |
Eclipse User |
|
|
|
Originally posted by: piculell.telia.com
Thanks Michael think I get your idea and might give it a try. But after
my vacation ;)
Meanwhile I implemented a very simple line by line diff in an SWT table,
that will work for now.
/Johan
Michael Valenta wrote:
> Johan,
>
> What you probably could do is create a custom ITypedElement that
> implemented IStreamContentAccessor for each String (i.e. these are
> interfaces that define the left and right inputs to a comparison). You
> could then make these the left and right sides of a DiffNode. You would
> then want to override CompareEditorInput to return this DiffNode from
> the prepareInput method. Finally, you could call either the open in
> editor or open in dialog method of CompareUI to show the comparison.
>
> Michael
>
> P.S. This is a pretty condensed set of instructions. If you require more
> detail on any particular step, just ask.
>
> Johan Piculell wrote:
>> Hi.
>> I was about to fix a side-by-side compare view of two strings
>> representing text documents, i.e. compare two text document that are
>> in memory and does not reside in any IResource.
>> But now I'm kind of lost in CompareUI, TextMergeViewer,
>> EditionSelectionDialog, etc.
>> Is there a smooth way of dealing with this or do I have to write my
>> own CompareEditorInput based on java strings...
>> I would really need a push in the right direction here
>>
>> thanks
>> /Johan
>>
|
|
|
Powered by
FUDForum. Page generated in 0.31776 seconds