Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Side by side compare of text
Side by side compare of text [message #317476] Wed, 04 July 2007 09:12 Go to next message
Eclipse UserFriend
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 #317515 is a reply to message #317476] Thu, 05 July 2007 13:17 Go to previous messageGo to next message
Eclipse UserFriend
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
>
Re: Side by side compare of text [message #317520 is a reply to message #317515] Thu, 05 July 2007 14:55 Go to previous message
Eclipse UserFriend
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
>>
Previous Topic:Marks not appearing in older version of eclipse
Next Topic:Where is the "XML Editor"?
Goto Forum:
  


Current Time: Fri May 09 01:56:49 EDT 2025

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

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

Back to the top