Skip to main content



      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 06:23 Go to next message
Eclipse UserFriend
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 09:04 Go to previous message
Eclipse UserFriend
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
Previous Topic:EMF compare support basic xml?
Next Topic:error occurred during: "Computing Model Differences"
Goto Forum:
  


Current Time: Thu Jul 10 02:49:19 EDT 2025

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

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

Back to the top