Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Java diff viewer Component?

Reply
Thread Tools

Java diff viewer Component?

 
 
Rogan Dawes
Guest
Posts: n/a
 
      11-30-2005
Hi folks,

I'm looking for a Swing Component that can display differences between
two files/streams/char arrays side by side, preferably with colour
highlighting.

Remarkably, it seems that such a thing is hard to come by, along with
Java implementations of various diff algorithms.

Any ideas?

For reference purposes, I have looked at implementing the Levenshtein
distance algorithm, as well as investigated ports of the GNU diff algo
to Java. These are both options, of course.

However, I guess that the diff algorithm would probably be dictated by
the diff viewer Component, so I'm not going too far in that direction yet.

License should preferably be GPL compatible, if at all possible.

Thanks for any suggestions.

Rogan.

P.S. The most obvious search result (JDiff) provides reports on the
differences between versions of the Java API Not quite what I was
looking for.
 
Reply With Quote
 
 
 
 
Jeffrey Schwab
Guest
Posts: n/a
 
      11-30-2005
Rogan Dawes wrote:
> Hi folks,
>
> I'm looking for a Swing Component that can display differences between
> two files/streams/char arrays side by side, preferably with colour
> highlighting.
>
> Remarkably, it seems that such a thing is hard to come by, along with
> Java implementations of various diff algorithms.
>
> Any ideas?
>
> For reference purposes, I have looked at implementing the Levenshtein
> distance algorithm, as well as investigated ports of the GNU diff algo
> to Java. These are both options, of course.
>
> However, I guess that the diff algorithm would probably be dictated by
> the diff viewer Component, so I'm not going too far in that direction yet.
>
> License should preferably be GPL compatible, if at all possible.
>
> Thanks for any suggestions.
>
> Rogan.
>
> P.S. The most obvious search result (JDiff) provides reports on the
> differences between versions of the Java API Not quite what I was
> looking for.


I've played with this before, but I didn't get to use it my own work
because of its GPL:

http://www.bmsi.com/java/#diff

Send the output to the textual display component of your choice.
 
Reply With Quote
 
 
 
 
Rogan Dawes
Guest
Posts: n/a
 
      12-01-2005
Jeffrey Schwab wrote:
> Rogan Dawes wrote:
>
>> Hi folks,
>>
>> I'm looking for a Swing Component that can display differences between
>> two files/streams/char arrays side by side, preferably with colour
>> highlighting.
>>
>> Remarkably, it seems that such a thing is hard to come by, along with
>> Java implementations of various diff algorithms.
>>
>> Any ideas?
>>
>> For reference purposes, I have looked at implementing the Levenshtein
>> distance algorithm, as well as investigated ports of the GNU diff algo
>> to Java. These are both options, of course.


[snip]

>
> I've played with this before, but I didn't get to use it my own work
> because of its GPL:
>
> http://www.bmsi.com/java/#diff
>
> Send the output to the textual display component of your choice.


Thanks for the response. I had also encountered that version, which is,
IIRC, a port of the gnu diff sources.

Rogan
 
Reply With Quote
 
Rogan Dawes
Guest
Posts: n/a
 
      12-05-2005
Rogan Dawes wrote:
> Hi folks,
>
> I'm looking for a Swing Component that can display differences
> between two files/streams/char arrays side by side, preferably with
> colour highlighting.
>
> Remarkably, it seems that such a thing is hard to come by, along with
> Java implementations of various diff algorithms.
>
> Any ideas?
>
> For reference purposes, I have looked at implementing the Levenshtein
> distance algorithm, as well as investigated ports of the GNU diff
> algo to Java. These are both options, of course.


Well, I gave up, and implemented one myself, based on the incava.org
Diff implementation.

You can take a look at it at:

(For the Diff sources)
<http://dawes.za.net/gitweb.cgi?p=dawes.za.net/webscarab.git;a=tree;h=148dc26a7ff3ef6ff5ddc35b206 d5f9f60a30489;hb=7fc5807cc8391a080d18d081edaf745ea 1f3a963;f=src/org/incava/util/diff>
and
(for the DiffPanel sources)
<http://dawes.za.net/gitweb.cgi?p=dawes.za.net/webscarab.git;a=tree;h=f6b756fbe78c6f1be21a00cffbe e5e904a0efcd9;hb=7fc5807cc8391a080d18d081edaf745ea 1f3a963;f=src/org/incava/util/diff/swing>

It needs some tweaking to improve configurability (e.g. the colours for
highlighting, etc), but it is reasonably usable as is.

Feedback appreciated.

Rogan
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
text viewer for blackberry or java sources of text viewer jacksgoogle Java 0 05-11-2005 08:29 AM
Diff CSS styles for diff INPUT TYPE='s? A Traveler ASP .Net 6 08-31-2004 09:17 PM
[ANN] Diff::LCS 1.1.0, Diff::LCS 1.0.4 Austin Ziegler Ruby 3 08-09-2004 06:34 AM
diff Process under diff users Cyril Vi?ville Perl 1 06-29-2004 06:22 PM
Same sessionID retuned to diff browsers in diff machines Berrucho ASP .Net 2 12-05-2003 02:23 PM



Advertisments