Jump to: navigation, search

Difference between revisions of "Compare"

 
(23 intermediate revisions by the same user not shown)
Line 1: Line 1:
In the 3.3 release, we are planning on working on some of the outstanding defects that have accumulated for the Compare component. Some of the areas we plan on looking at are:
+
This page contains links related to the Eclipse Compare Framework
  
* Asynchronous loading and update of compare editors
+
*[[Compare Word Documents | Comparing Word Documents in Eclipse]]
* Improving the save life-cycling
+
*[http://www.eclipse.org/documentation/ On-line documentation]
* Improving difference and change Navigation
+
*[[Team | Team Wiki Page]]
* Use of text buffers when comparing local content
+
*[[Platform | Platform Wiki Page]]
* Upgrade to use the new Commands/Key bindings framework
+
* Switch to using the History view for local history operations (Compare/Replace/Restore)
+
  
The following sections outline some thoughts on each of these areas.
+
[[Category:Eclipse Project]]
 
+
== Save Life-cycle ==
+
 
+
Saving properly in the Compare framework has always been a bit of a black art. See bug [https://bugs.eclipse.org/bugs/show_bug.cgi?id=125538 125538] for a description of one way of making it work. The reason for this is the layered nature of the Compare framework. For a local file, the layers are:
+
 
+
# The file (instance of IFile)
+
# The ResourceNode (instance of IEditableContent)
+
# The TextMergeViewer
+
 
+
Assume you have an merge viewer open and edit the left side. A save is triggered by a Save operation or selecting another element to edit. What happens in this case is the following:
+
 
+
# save is called on ContentMergeViewer
+
# save obtains the content from the left side of the content merge viewer.
+
# content from document is passed to the viewer content provider (instance of MergeViewerContentProvider)
+
# the content provider calls saveContent on the left typed element of the compare input if the compare input is an IEditableContent).
+
# the ResourceNode updates its buffer to contain the new content and fire a change event
+
# if you want the file to be saved, you would need to listen to that event and call commit on the ResourceDiffNode
+
 
+
There are a couple of observations that can be made about this:
+
 
+
* The ContentMergeViewer save lifecycle only works with byte oriented content.
+
* Both the document in the TextMergeViewer and the ResourceNode buffer the contents of the file (that means there are at least two in-memory versions of the file for each side (and the ancestor if there is one).
+
* the save method of ContentMergeViewer is really a flush.
+
 
+
I have entered bug [https://bugs.eclipse.org/bugs/show_bug.cgi?id=150526 150526] to request that the use of BufferedContent be avoided for remote files.
+
 
+
I have reopened bug [https://bugs.eclipse.org/bugs/show_bug.cgi?id=114 114] to consider linking resource nodes (and also possibly IStorage nodes) with underlying file buffers so that in-memory content is shared between editors.
+

Latest revision as of 12:15, 11 June 2008

This page contains links related to the Eclipse Compare Framework