Blog | Crank Software

Stop, Collaborate and Listen

Written by Rodney Dowdall | Aug 17, 2010 1:42:16 PM

My original intention for this blog post was to write it as a complete parody of the song "Ice Ice Baby" by Vanilla Ice.  In the end I decided against that because the point of the blog post would probably be obscured, I might get sued, and it would more than likely be harder to do than I think.

So I'll just drop the gimmickry  and tell you about what I have been working on for the last little bit.  I've been working on extending the org.eclipse.compare functionality in Eclipse to allow the comparison of  two GDE files and highlight the differences between them.

For the most part it is up and running.  It wasn't as extensible  as I would have liked.  I had to duplicate some code for the differencer, the class that handles computing differences, which I don't think I should have had to do.  I would have liked to have been able to just extend the base differencer class and swap out the diff method, but due to some private methods and fields within the class, I couldn't.  I ended up duplicating the base differencer class in it's entirety and a just switching over the pieces that I needed in order to compare to of our models.

Another thing that struck me as odd is that there doesn't seem to be an easy way to tell the compare view which comparators to use.  The base view tries to do some guessing, and it guess badly.  For example, we have a tree view of our model and a graphical view of our model.  You can select these from a drop down box.  The drop down box also contains an entry for a text comparator.  I don't really want that there as I don't want people to compare the text of two GDE files.  I tried to remove it but it gets added by a piece of code in the core compare stuff that opens up the file that it is comparing, reads in the file, and if it is less than 3000 lines, assumes that it is a text file.  Also there doesn't seem to be an easy way to override this behaviour without duplicating a lot of code that shouldn't be duplicated.  I intended to submit a bug to eclipse on this one because it just doesn't seem like the right thing to do.

All in all the core functionality has been added to the feature.  Just a couple more bugs to clean up and our compare plugin should be ready for prime time.  Look for it soon in a crank update site near you.

- Rodney