Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Mapping left/right to old/new in Compare API two-way diffs
Mapping left/right to old/new in Compare API two-way diffs [message #324173] Fri, 18 January 2008 05:54
Eclipse UserFriend
Hi,

While implementing some custom diff and merge viewers, I noticed various
quirks of the Compare API:

- In Eclipse's compare viewers "new" is usually on the left side (e.g.
when using "Compare - With Each Other" from the "History" view. This is
somehow against intuition (at least for left-to-right locales). OK.

- When using "Compare - With Each Other" from a navigator, whatever
element that happens to be the first one in the selection is regarded as
the "new" element, independent of the file date, CVS revision etc. I
guess this behaviour occurs because it's impossible to extract an
unambiguous timestamp from all kinds of compare input, so that's OK, too.

- However, org.eclipse.compare.structuremergeviewer.Differencer
generates an addition for left == null, right != null. I found some code
in compare viewer classes (CompareConfiguration,
DiffTreeViewer.DiffViewerLabelProvider etc.) that seems to swap left and
right for the purpose of display. However, this is quite confusing when
accessing or generating DiffNodes in your own code.

Niklas
Previous Topic:getting method description
Next Topic:[Databinding]Handling List,Set
Goto Forum:
  


Current Time: Sun Jul 13 01:15:21 EDT 2025

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

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

Back to the top