Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Problems when implementing structure compare view in RCP
icon5.gif  Problems when implementing structure compare view in RCP [message #758383] Tue, 22 November 2011 18:31 Go to next message
Robin7  is currently offline Robin7
Messages: 2
Registered: November 2011
Junior Member
I've been working on the implementation of a structure compare and merge function of a text based file through eclipse compare infrastructure.

Through the FAQ (wiki.eclipse.org/FAQ_How_can_I_use_and_extend_the_compare_infrastructure), I've got a basic idea of how to do it. And the guide at (help.eclipse.org/indigo/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/compare_contentviewer.htm) helped me to understand more about how to implement the structure viewer using StructureCreator.

So basically I extended the structureCreators extension point and created my own StructureCreator using the tree structure from the parsing result of the text file. Yes, our special language format in the text file can be parsed into a tree structure. And so far I can see the correct structural differences of two files in the tree view in the upper part of the whole comparing window.

However, my problem is that when I double click a tree node, it does not bring up the differences of the nodes in the two panes in the lower part of window. It just displays nothing, not like when comparing two java files in the eclipse.

I think this problem has something to do with the shared document as the guide says:

Quote:
For text based inputs, clients should subclass the StructureCreator class. This will enable the use of a shared document between multiple editors open on the same file. Subclasses of StructureCreator that provide syntax highlighting must implement both the getDocumentPartitioner() and getDocumentPartitioning90 methods to support shared documents.


However, I don't know where went wrong. Do I need to extend more extension points such as structureMergeViewers to make it work or just to add more stuff in the subclass of StructureCreator to make it right?

And If I want to support syntax highlighting, What more things do I need to do? the above quoted instructions are too simple to follow.

I wish some eclipse dev experts with such experience can help me with this. Thanks!
Re: Problems when implementing structure compare view in RCP [message #759534 is a reply to message #758383] Mon, 28 November 2011 22:20 Go to previous message
Robin7  is currently offline Robin7
Messages: 2
Registered: November 2011
Junior Member
Finally I found the answer myself. I just post it here in case someone has the same problem in the future.

It turns out I need to return an object that extends DocumentRangeNode from StructureCreator.createStructureComparator(...)

I am still working on how to make the compare viewer has syntax highlighting.
Previous Topic:Calculate RCP Product Classpath for Embedded Eclipse Compiler
Next Topic:Traverse all columns of the table n functinality issues
Goto Forum:
  


Current Time: Mon Jul 28 14:43:39 EDT 2014

Powered by FUDForum. Page generated in 0.01414 seconds