|
Re: Can't Undo Sirius deletion in RCP [message #1859496 is a reply to message #1859495] |
Mon, 12 June 2023 07:58 |
|
Hi,
It's possible that the "Delete" operation actually triggers several commands in your case, e.g. one for the deletion of the element and refresh of the diagram, and then someone reacts to the deletion with another change.
In this case your "Undo" would only apply to the second command and not to the deletion.
This might depend on the actual modeler you use if it does some non-standard things.
I just tested the basic scenarion on Ecore Tools (which is based on Sirius), and it works with a single Ctrl-Z.
After you've deleted the element, look at the "Edit" menu in the window's menu bar. It should mention "Undo Delete element (Ctrl-Z)". If it does not, then something has executed another command in reaction to the delete, and you may need several "Undo" operations to actually undo the delete.
Regards,
Pierre-Charles
Pierre-Charles David - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Re: Can't Undo Sirius deletion in RCP [message #1859509 is a reply to message #1859496] |
Tue, 13 June 2023 00:38 |
Jerry Zh Messages: 2 Registered: June 2023 |
Junior Member |
|
|
Dear Pierre-Charles:
Thank you for your quick reply. According to your hint, I found the problem is in RCP. In RCP application, I create "Edit" menu through Extensions.
<menu
label="Edit">
<command
commandId="org.eclipse.ui.edit.undo"
id="undo"
label="Undo"
style="push">
</command>
<command
commandId="org.eclipse.ui.edit.redo"
label="Redo"
style="push">
</command>
I guess I missing something in code. If realize "Edit" menu in code ApplicationActionBarAdvisor:
@Override
protected void makeActions(IWorkbenchWindow window) {
undo = ActionFactory.UNDO.create(window);
redo = ActionFactory.REDO.create(window);
}
@Override
protected void fillMenuBar(IMenuManager menuBar) {
editMenu = new MenuManager("&Edit", IWorkbenchActionConstants.M_EDIT);
menuBar.insertAfter("file", editMenu);
editMenu.add(undo);
editMenu.add(redo);
}
Undo can works correctly.
[Updated on: Tue, 13 June 2023 03:25] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04233 seconds