@Override
	public void runWithEvent(IAction action, Event event) {
		updateEnablement(action);
		if (action.isEnabled()) {
			ISelection currentSelection = getSelection();
			Set<EPlanElement> selected = PlanEditorUtil.emfFromSelection(currentSelection);
			final MoveToOrbitOperation op = new MoveToOrbitOperation(selected);
			String errorMsg = op.analyzeMistakenSelection();
			if (errorMsg != null) {
				LogUtil.warn(errorMsg);
				ErrorDialog.openError(WidgetUtils.getShell(), "Nothing to Move To " + OrbitEventUtil.ORBIT_NAME,
						"No orbit-related plan elements selected.",
						new ExceptionStatus(EditorPlugin.ID, errorMsg, new ExecutionException(selected.toString())));
				return;
			}
			try {
				String orbitId = promptForValue();
				if (orbitId != null) {
					op.setOrbitId(orbitId);
					IUndoContext undoContext = getUndoContext();
					CommonUtils.execute(op, undoContext);
					String errorMsg2 = op.analyzeMissingOrbitDestination();
					if (errorMsg2 != null) {
						LogUtil.warn(errorMsg2);
						//TODO:  Use the new WidgetUtils.showErrorToUser method.
						ErrorDialog.openError(WidgetUtils.getShell(), "Move To " + OrbitEventUtil.ORBIT_NAME,
								"Move To " + OrbitEventUtil.ORBIT_NAME +  " may not have done what you expected.",
								new ExceptionStatus(EditorPlugin.ID, errorMsg2, new ExecutionException(selected.toString())));
						return;
					}
				}
			}
			catch (Exception e) {
					IStatus error = new ExceptionStatus(EditorPlugin.ID, e.getMessage(), e);
					ErrorDialog.openError(WidgetUtils.getShell(), "An error occurred", "That didn't work.", error);
				}
			}
		}
@Override
	public void runWithEvent(IAction action, Event event) {
		updateEnablement(action);
		if (action.isEnabled()) {
			ISelection currentSelection = getSelection();
			Set<EPlanElement> selected = PlanEditorUtil.emfFromSelection(currentSelection);
			final MoveToOrbitOperation op = new MoveToOrbitOperation(selected);
			String errorMsg = op.analyzeMistakenSelection();
			if (errorMsg != null) {
				LogUtil.warn(errorMsg);
				ErrorDialog.openError(WidgetUtils.getShell(), "Nothing to Move To " + OrbitEventUtil.ORBIT_NAME,
						"No orbit-related plan elements selected.",
						new ExceptionStatus(EditorPlugin.ID, errorMsg, new ExecutionException(selected.toString())));
				return;
			}
			try {
				String orbitId = promptForValue();
				if (orbitId != null) {
					op.setOrbitId(orbitId);
					IUndoContext undoContext = getUndoContext();
					CommonUtils.execute(op, undoContext);
					String errorMsg2 = op.analyzeMissingOrbitDestination();
					if (errorMsg2 != null) {
						LogUtil.warn(errorMsg2);
					
						ErrorDialog.openError(WidgetUtils.getShell(), "Move To " + OrbitEventUtil.ORBIT_NAME,
								"Move To " + OrbitEventUtil.ORBIT_NAME +  " may not have done what you expected.",
								new ExceptionStatus(EditorPlugin.ID, errorMsg2, new ExecutionException(selected.toString())));
						return;
					}
				}
			}
			catch (Exception e) {
					IStatus error = new ExceptionStatus(EditorPlugin.ID, e.getMessage(), e);
					ErrorDialog.openError(WidgetUtils.getShell(), "An error occurred", "That didn't work.", error);
				}
			}
		}
@override public void runwithevent(iaction action, event event) { updateenablement(action); if (action.isenabled()) { iselection currentselection = getselection(); set<eplanelement> selected = planeditorutil.emffromselection(currentselection); final movetoorbitoperation op = new movetoorbitoperation(selected); string errormsg = op.analyzemistakenselection(); if (errormsg != null) { logutil.warn(errormsg); errordialog.openerror(widgetutils.getshell(), "nothing to move to " + orbiteventutil.orbit_name, "no orbit-related plan elements selected.", new exceptionstatus(editorplugin.id, errormsg, new executionexception(selected.tostring()))); return; } try { string orbitid = promptforvalue(); if (orbitid != null) { op.setorbitid(orbitid); iundocontext undocontext = getundocontext(); commonutils.execute(op, undocontext); string errormsg2 = op.analyzemissingorbitdestination(); if (errormsg2 != null) { logutil.warn(errormsg2); errordialog.openerror(widgetutils.getshell(), "move to " + orbiteventutil.orbit_name, "move to " + orbiteventutil.orbit_name + " may not have done what you expected.", new exceptionstatus(editorplugin.id, errormsg2, new executionexception(selected.tostring()))); return; } } } catch (exception e) { istatus error = new exceptionstatus(editorplugin.id, e.getmessage(), e); errordialog.openerror(widgetutils.getshell(), "an error occurred", "that didn't work.", error); } } }