Reputation: 1209
I am creating a plugin which will have two buttons to perform Undo and Redo operation on a particular node. I want to know if it is possible to execute the IDE undo and redo operation problematically?
Upvotes: 0
Views: 80
Reputation: 1209
I found the below code performs the Undo and Redo operation in Jetbrain's MPS.
foreach editor in FileEditorManager.getInstance(project).getAllEditors() {
if (editor.getName() != null && editor.getName().equals("EDITER_TO_UPDATE")) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
if (operations.equals(Operations.UNDO)) {
UndoManagerImpl.getInstance(project).undo(editor);
} else if (operations.equals(Operations.REDO)) {
UndoManagerImpl.getInstance(project).redo(editor);
}
}
});
}
}
Upvotes: 1