Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF Diff/Merge » Undo and Redo operation in Diff/Merge(i am unable to customize the Undo and Redo operation in EMF Diff/merge)
Undo and Redo operation in Diff/Merge [message #1739612] Wed, 03 August 2016 09:27 Go to next message
Ramen Guchhait is currently offline Ramen GuchhaitFriend
Messages: 3
Registered: August 2016
Junior Member
I have created my own action in Diff/Merge tool but I want to put the undo and redo operation in that action .I'm using the ICompareEditingDomain but when I use the undo.update() or redo.update it wont work.
here is my code..


public void createContributionItems(IServiceLocator serviceLocator, IContributionRoot additions)
{
ResourceSet resourceSet1 = new ResourceSetImpl();
ResourceSet resourceSet2 = new ResourceSetImpl();
IComparisonScope scope = new DefaultComparisonScope(resourceSet1, resourceSet2, null);
ICompareEditingDomain editingDomain = EMFCompareEditingDomain.create(scope.getLeft(), scope.getRight(), null);
UndoAction undo=new UndoAction(editingDomain);
RedoAction redo=new RedoAction(editingDomain);
IAction a = new Action()
{
public void run()
{
System.out.println("Hello action");
undo.run();


}
};

a.setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin("com.avin.emf.custom.compare", "icons/undo.png"));
a.setToolTipText("Undo The Merge");
IAction b = new Action()
{
public void run()
{
redo.update();

System.out.println("Hello Myaction");


}
};
b.setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin("com.avin.emf.custom.compare", "icons/redo.png"));
b.setToolTipText("Redo The merge");

item = new ActionContributionItem(a);
item2=new ActionContributionItem(b);
serviceLocator=PlatformUI.getWorkbench();
IMenuService menusService=(IMenuService)serviceLocator.getService(IMenuService.class);
if(menusService!=null)
{
additions.addContributionItem(item,null);
additions.addContributionItem(item2,null);
System.out.println("hello");
}


}
Re: Undo and Redo operation in Diff/Merge [message #1740645 is a reply to message #1739612] Tue, 16 August 2016 15:35 Go to previous message
Olivier Constant is currently offline Olivier ConstantFriend
Messages: 92
Registered: January 2012
Member
Hi, it seems you posted to the wrong forum. You should post to Home » Modeling » Compare instead. Smile
Previous Topic:How to use EMF Diff/Merge programmatically
Next Topic:Incremental mode and delete element
Goto Forum:
  


Current Time: Mon Oct 15 15:13:51 GMT 2018

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

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

Back to the top