Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Compare » Customize EMF Compare Toolbar(Customize EMF Compare Toolbar)
Customize EMF Compare Toolbar [message #1738195] Mon, 18 July 2016 05:33 Go to next message
Gaurav Tripathi is currently offline Gaurav TripathiFriend
Messages: 43
Registered: September 2015
Member
Hi everyone,
We are looking into customizing EMF Compare dialog.
Q1:
Can we remove buttons in the toolbar e.g the merge icons/merging from left to right ? If yes how ?
Q2:
Is it possible to inject new buttons in the toolbar ?
Q3:
How can we implement undo and redo actions ? For example, if I provide this actions on a button in the toolbar ?

Re: Customize EMF Compare Toolbar [message #1738353 is a reply to message #1738195] Tue, 19 July 2016 08:57 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Q1:
No, these buttons are contributed by default and there is no way to rmove them. There are no plans to make them removeable.

Q2:
The toolbar picks up menu contributions for "toolbar:org.eclipse.emf.compare.structuremergeviewer.toolbar" so you can just inject buttons through the usual eclipse extension points.

Q3:
undo and redo are already implemented and available through the usual ctrl+z (undo) and ctrl+y (redo).

Laurent Goubet
Obeo
Re: Customize EMF Compare Toolbar [message #1738358 is a reply to message #1738353] Tue, 19 July 2016 09:21 Go to previous messageGo to next message
Gaurav Tripathi is currently offline Gaurav TripathiFriend
Messages: 43
Registered: September 2015
Member
Thanks for your valuable response.

Q1.
For my customization, I want to remove some button. So is it not possible even if I extend EMFStructureMergeViewer and create a new toolbar and implement same as yours.

Q3.
I know it's implemented but I want to give it through some button for my use case. So I just wanted to know where is its functionality in which class ?


Thanks again.
Re: Customize EMF Compare Toolbar [message #1738482 is a reply to message #1738358] Wed, 20 July 2016 09:30 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Hi,

The EMFCompareStructureMergeViewer hasn't been implemented with extension capabilities in mind, so you'll likely have quite a hard time overriding it. For example, its toolbar isn't easily replaceable since it's created right at instantiation time and is registered as a listener against the event bus we use internally. You could prevent the addition of the merge buttons by making both models uneditable (through the EMFCompareConfiguration) if that can work for you.

UndoAction and RedoAction in the org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.util package. This simply goes through our ICompareCommand stack to un/redo the last action. You can access that through the compare configuration (
getCompareConfiguration().getEditingDomain().getCommmandStack()
).

Laurent Goubet
Obeo
Previous Topic:UML Diagram for EMF Compare
Next Topic:Add node in Tree View of StructureMergeViewer and CompareMergeViewer
Goto Forum:
  


Current Time: Wed Apr 24 17:40:00 GMT 2024

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

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

Back to the top