0

I have a customized view. I basically Move an element from one folder to another. After Move i am setting the selection on the new element. Still the Eclipse Undo is not enabled. I expect it to come as "Undo Move Resources" as it happens in Project Explorer.

Could anyone please tell what basically needs to be done for the "undo move resources" to be enabled? how does it work?

Regards, Pavitra

R.P
  • 11
  • 1
  • 5

2 Answers2

0

Undo seems not to be implemented in your customized view so there is no chance to enable it. You might ask the author to build this feature for you.

Kai
  • 38,985
  • 14
  • 88
  • 103
0

You can use the org.eclipse.ui.ide.undo.MoveResourcesOperation class to perform a resource move operation with Undo. You use something like:

AbstractWorkspaceOperation op = new MoveResourcesOperation(resources, destinationPath, "label");

PlatformUI.getWorkbench().getOperationSupport()
                .getOperationHistory().execute(op, monitor,
                        WorkspaceUndoUtil.getUIInfoAdapter(messageShell));

You might be able to use org.eclipse.ui.actions.MoveResourceAction which does all the work for this. See also org.eclipse.ui.actions.MoveFilesAndFoldersOperation and org.eclipse.ui.actions.CopyFilesAndFoldersOperation

greg-449
  • 109,219
  • 232
  • 102
  • 145