/** * Execute the specified undoable operation */ void execute(IUndoableOperation operation, String title, IProgressMonitor monitor, IAdaptable uiInfo) { try { PlatformUI.getWorkbench().getOperationSupport() .getOperationHistory().execute(operation, monitor, uiInfo); } catch (ExecutionException e) { if (e.getCause() instanceof CoreException) { ErrorDialog.openError(view.getShell(), title, null, ((CoreException)e.getCause()).getStatus()); } else { IDEWorkbenchPlugin.log(title, e); } } }
@Override public void run() { if (getSelectedResources().isEmpty()) return; IResource resource= getSelectedResources().get(0); if (resource != null) { if (promptForName) { BookmarkPropertiesDialog dialog= new BookmarkPropertiesDialog(shellProvider.getShell()); dialog.setResource(resource); dialog.open(); } else { Map attrs= new HashMap(); attrs.put(IMarker.MESSAGE, resource.getName()); CreateMarkersOperation op= new CreateMarkersOperation(IMarker.BOOKMARK, attrs, resource, BookmarkMessages.CreateBookmark_undoText); try { PlatformUI.getWorkbench().getOperationSupport().getOperationHistory().execute(op, null, WorkspaceUndoUtil.getUIInfoAdapter(shellProvider.getShell())); } catch (ExecutionException e) { IDEWorkbenchPlugin.log(null, e); // We don't care } } } }
/** * Execute the specified undoable operation. * * @param operation the operation to execute * @since 3.3 */ private void execute(IUndoableOperation operation) { final Shell shell= getTextEditor().getSite().getShell(); IAdaptable context= new IAdaptable() { public Object getAdapter(Class adapter) { if (adapter == Shell.class) return shell; return null; } }; IOperationHistory operationHistory= PlatformUI.getWorkbench().getOperationSupport().getOperationHistory(); try { operationHistory.execute(operation, null, context); } catch (ExecutionException e) { Bundle bundle= Platform.getBundle(PlatformUI.PLUGIN_ID); ILog log= Platform.getLog(bundle); String msg= getString(fBundle, fPrefix + "error.dialog.message", fPrefix + "error.dialog.message"); //$NON-NLS-2$ //$NON-NLS-1$ log.log(new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, IStatus.OK, msg, e)); } } }
/** * Execute the specified undoable operation */ void execute(IUndoableOperation operation, String title, IProgressMonitor monitor, IAdaptable uiInfo) { try { PlatformUI.getWorkbench().getOperationSupport() .getOperationHistory().execute(operation, monitor, uiInfo); } catch (ExecutionException e) { if (e.getCause() instanceof CoreException) { ErrorDialog .openError(WorkspaceUndoUtil.getShell(uiInfo), title, null, ((CoreException) e.getCause()) .getStatus()); } else { IDEWorkbenchPlugin.log(title, e); } } }
/** * Execute the specified undoable operation. * * @param operation the operation to execute * @since 3.3 */ private void execute(IUndoableOperation operation) { final Shell shell= getTextEditor().getSite().getShell(); IAdaptable context= new IAdaptable() { @SuppressWarnings("unchecked") @Override public <T> T getAdapter(Class<T> adapter) { if (adapter == Shell.class) return (T) shell; return null; } }; IOperationHistory operationHistory= PlatformUI.getWorkbench().getOperationSupport().getOperationHistory(); try { operationHistory.execute(operation, null, context); } catch (ExecutionException e) { Bundle bundle= Platform.getBundle(PlatformUI.PLUGIN_ID); ILog log= Platform.getLog(bundle); String msg= getString(fBundle, fPrefix + "error.dialog.message", fPrefix + "error.dialog.message"); //$NON-NLS-2$ //$NON-NLS-1$ log.log(new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, IStatus.OK, msg, e)); } } }
.getOperationHistory().execute(op, new NullProgressMonitor(), WorkspaceUndoUtil.getUIInfoAdapter(getShell())); } catch (ExecutionException e) {
.getOperationSupport() .getOperationHistory() .execute( op, monitor,
desc.setLocation(folder.getLocation()); CreateProjectOperation operation = new CreateProjectOperation(desc, desc.getName()); IStatus status = OperationHistoryFactory.getOperationHistory().execute(operation, null, null); if (status.isOK()) { IProject newProject = (IProject) operation.getAffectedObjects()[0];
try { PlatformUI.getWorkbench().getOperationSupport() .getOperationHistory().execute(op1, monitor, WorkspaceUndoUtil.getUIInfoAdapter(shellProvider.getShell())); } catch (ExecutionException e) {
IOperationHistory operationHistory= PlatformUI.getWorkbench().getOperationSupport().getOperationHistory(); try { operationHistory.execute(operation, null, context); } catch (ExecutionException x) { Bundle bundle= Platform.getBundle(PlatformUI.PLUGIN_ID);
IOperationHistory operationHistory= PlatformUI.getWorkbench().getOperationSupport().getOperationHistory(); try { operationHistory.execute(operation, null, context); } catch (ExecutionException x) { Bundle bundle= Platform.getBundle(PlatformUI.PLUGIN_ID);
.getOperationHistory().execute(op, monitor, WorkspaceUndoUtil.getUIInfoAdapter(shellProvider.getShell())); } catch (ExecutionException e) {
try { PlatformUI.getWorkbench().getOperationSupport() .getOperationHistory().execute(op1, monitor, WorkspaceUndoUtil.getUIInfoAdapter(shellProvider.getShell())); } catch (ExecutionException e) {
/** * Execute the specified undoable operation * * @param operation * @param title * @param monitor * @param uiInfo */ public void execute(IUndoableOperation operation, String title, IProgressMonitor monitor, IAdaptable uiInfo) { try { PlatformUI.getWorkbench().getOperationSupport() .getOperationHistory().execute(operation, monitor, uiInfo); } catch (ExecutionException e) { if (e.getCause() instanceof CoreException) { StatusManager.getManager().handle( StatusUtil .newStatus(IStatus.ERROR, title, e.getCause()), StatusManager.SHOW); } else { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, title, e)); } } }
PlatformUI.getWorkbench() .getOperationSupport() .getOperationHistory().execute(op, null, WorkspaceUndoUtil.getUIInfoAdapter(getShell())); } catch (ExecutionException e) {
IOperationHistory operationHistory= PlatformUI.getWorkbench().getOperationSupport().getOperationHistory(); try { operationHistory.execute(deleteMarkerOperation, progressMonitor, context); } catch (ExecutionException e) { throw new CoreException(DebugUIPlugin.newErrorStatus("Exception while deleting breakpoint markers", e)); //$NON-NLS-1$