Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Compare » Custom merge viewer(If HTML, then show SWT.Browser left and right)
Custom merge viewer [message #1264636] Wed, 05 March 2014 11:23 Go to next message
Thomas Laegler is currently offline Thomas LaeglerFriend
Messages: 4
Registered: February 2014
Junior Member
Hi everybody,

Im using EMF-Compare and made some customizations. Now i want to show a SWT.Browser, when the Diff is a certain Xhtml-Element. Which classes do I have to extend?

What I have until now:


  • a custom HtmlMergeViewerCreator implements IViewerCreator
  • a custom HtmlMergeViewer extends ContentMergeViewer
  • and a extension to extension-point org.eclipse.compare.contentMergeViewers in plugin.xml, which points to my HtmlMergeViewerCreator


When I compare two files, my custom merge viewer opens on the first Diff.
But when i navigate to a HTML Diff the default EMF Model Compare opens instead of my custom merge viewer. And I can't select my HTML Viewer

What is missing? Anybody knows? Every hint is appreciated!
Re: Custom merge viewer [message #1265749 is a reply to message #1264636] Thu, 06 March 2014 14:04 Go to previous message
Axel RICHARD is currently offline Axel RICHARDFriend
Messages: 43
Registered: September 2010
Location: France
Member
Hi,

I think you should add your own Accessor for Xhtml-Elements. In EMF Compare, Accessors allows to bind elements in the StructureMergeViewer (top panel) to the elements in the ContentMergeViewers (down panels).
The extension point is org.eclipse.emf.compare.rcp.ui.accessorFactory.
You'll have to provide to this extension point a specialization of http://git.eclipse.org/c/emfcompare/org.eclipse.emf.compare.git/tree/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/contentmergeviewer/accessor/factory/impl/AbstractAccessorFactory.java and a ranking. This ranking must be greater than the existing ones (> 15).
You can find examples of existing AccessorFactories here: http://git.eclipse.org/c/emfcompare/org.eclipse.emf.compare.git/tree/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/contentmergeviewer/accessor/factory/impl
These AccessorFactories are used in the http://git.eclipse.org/c/emfcompare/org.eclipse.emf.compare.git/tree/plugins/org.eclipse.emf.compare.rcp.ui/plugin.xml

Hope it can help you.

Axel


Axel Richard
Obeo
Previous Topic:EMF compare support basic xml?
Next Topic:error occurred during: "Computing Model Differences"
Goto Forum:
  


Current Time: Tue Mar 19 11:24:17 GMT 2024

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

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

Back to the top