Custom compare [message #636651] |
Tue, 02 November 2010 06:54  |
Eclipse User |
|
|
|
Hi all.
I have developed a plugin that store in text files (the file extension is .ABSClass) some definitions used by a generator to generate the real .java sources.
Those .ABSClass files has more section, one of them
is the methods description.
The Eclipse's text compare works fine when comparing different version using svn or cvs plugin but it compares (correctly!) the whole file.
But now I need to build my custom "compare view" to
display to user the differences between two .ABSClass version when files are different in methos's description only, so, in other works, I need to compare only a piece of my .ABSClass file
I need that view to be displayed when
1) The file extension is .ABSClass
2) The user double clicks in SVN or CVS history view
3) The user performs "team -> compare with..." action
I have made several searches to find out how to start this kind of job, but I have not found something that may help
me in this activity.
Could someone give me some documentation link, tip,
or any other suggestion that may my help?
Thank you very much in advance.
[Updated on: Tue, 02 November 2010 06:56] by Moderator
|
|
|
Re: Custom compare [message #637098 is a reply to message #636651] |
Thu, 04 November 2010 04:15  |
Eclipse User |
|
|
|
Hi, at least I have found a solution.
I do not know if is the best way to solve my problem, but works.
I post here because I hope that might be useful for other users
In my plugin I have added two news extension points:
1) org.eclipse.compare.contentMergeViewers
here I have added my custom class MyViewerCreator (as viewer) , providing as extensions: myextxml
2) org.eclipse.compare.StructureCreators
here I have added my custom Class MyStructureCreator (as structureCreator), providing as extensions: myext
The new two custom classes basically do so:
1) MyStructureCreator (implements IStructureCreator)
in method: public IStructureComparator getStructure(Object aInput)
I've parsed my custom source file and returned the piece of source code to be evaluated by compare engine in an IStructureComparator object
2) MyViewerCreator (implements IViewerCreator)
in method: public Viewer createViewer(Composite aParent, CompareConfiguration aCC)
I return a new istance of org.eclipse.compare.contentmergeviewer.TextMergeViewer
Hope it's enough clear
Regards
|
|
|
Powered by
FUDForum. Page generated in 0.03343 seconds