Java 类org.eclipse.gef.ui.actions.SaveAction 实例源码

项目:FRaMED    文件:StepAction.java   
/**
 * 
 * Execute the command that performs the StepIn or the StepOut.
 * 
 * It is assumed that this method is executed directly after {@link Step#calculateEnabled()
 * calculateEnabled()}
 */
@Override
public void run() {
  // get the editorpart to get the selection manager and with the selection manager you can
  // deselect the selected element after the creation of the attribute or the method
  ORMGraphicalEditor editorPart =
      (ORMGraphicalEditor) ((DefaultEditDomain) editPart.getViewer().getEditDomain())
          .getEditorPart();

  SaveAction save = new SaveAction(editorPart);
  // send the request to the editpart for execution.
  execute(editPart.getCommand(request));
  save.run();

  // deselect the selected element for case that the user forget to deselect the element
  // when not deselected the shortcut behaviour and the contextmenu behaviour can confuse the user
  editorPart.getOwnViewer().getSelectionManager().deselectAll();
}