Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Compare » Custumize MergeAction(I want to redefine the MergaAction used in CompareToolBar)
Custumize MergeAction [message #1816222] Thu, 24 October 2019 09:44 Go to next message
Stéphanie Piccin is currently offline Stéphanie PiccinFriend
Messages: 7
Registered: June 2018
Junior Member
Hello,

I use the emf compare plugin in my own RCP.

When the Compare Editor is displayed, i want to redefine the MergeAction because I want to check if the merge is possible for the selection in the TreeViewer.

How can i customize the CompareToolBar to use another class of MergeAction ?

Thanks.
Re: Custumize MergeAction [message #1816347 is a reply to message #1816222] Mon, 28 October 2019 08:55 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Hello,

We have not designed the compare tool bar to be easily customizable so you will likely have to copy/paste some code along the way. For this you will have to provide your own implementation of StructureMergeViewer (through the org.eclipse.compare.structureMergeViewers extension point, you can see an example of how we're doing it in EMF Compare here). From this you should be able to subclass org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.EMFCompareStructureMergeViewer and override the createToolBar(ToolBarManager) method in order to provide your own in which you'll customize the merge actions.

Regards,

Laurent Goubet
Obeo
Re: Custumize MergeAction [message #1816915 is a reply to message #1816222] Tue, 12 November 2019 07:30 Go to previous message
Stéphanie Piccin is currently offline Stéphanie PiccinFriend
Messages: 7
Registered: June 2018
Junior Member
Hello Laurent,

thanks for your answer, I tried to define a new extension point of "org.eclipse.compare.structureMergeViewers" .
When the "findStructureViewer(..)" method of the CompareUIPlugin class is called, my extension point is loaded and the "descriptors" variable contains 2 extensions point after this line :
"ViewerDescriptor[] descriptors = findStructureViewerDescriptor(oldViewer, input, configuration);"

Then, this line of code

"return getViewer(descriptors[0], oldViewer, parent, configuration);"

calls always the extension point of the "org.eclipse.emf.compare.ide.ui" plugin and never mine.

So I don't know how change it.

Stéphanie.
Previous Topic:Standard PostProcessor to handle Refactor Rename ?
Next Topic:Using org.eclipse.compare.compareFilters
Goto Forum:
  


Current Time: Fri Apr 26 07:50:51 GMT 2024

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

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

Back to the top