/** * The <code>TextOperationAction</code> implementation of this * <code>IAction</code> method runs the operation with the current * operation code. */ public void run() { if (fOperationCode == -1 || fOperationTarget == null) return; ITextEditor editor= getTextEditor(); if (editor == null) return; if (!fRunsOnReadOnly && !validateEditorInputState()) return; Display display= null; IWorkbenchPartSite site= editor.getSite(); Shell shell= site.getShell(); if (shell != null && !shell.isDisposed()) display= shell.getDisplay(); BusyIndicator.showWhile(display, new Runnable() { public void run() { fOperationTarget.doOperation(fOperationCode); } }); }
/** * The <code>TextOperationAction</code> implementation of this * <code>IAction</code> method runs the operation with the current * operation code. */ @Override public void run() { if (fOperationCode == -1 || fOperationTarget == null) return; ITextEditor editor= getTextEditor(); if (editor == null) return; if (!fRunsOnReadOnly && !validateEditorInputState()) return; Display display= null; IWorkbenchPartSite site= editor.getSite(); Shell shell= site.getShell(); if (shell != null && !shell.isDisposed()) display= shell.getDisplay(); BusyIndicator.showWhile(display, new Runnable() { @Override public void run() { fOperationTarget.doOperation(fOperationCode); } }); }
/** * The <code>TextOperationAction</code> implementation of this * <code>IAction</code> method runs the operation with the current * operation code. */ @Override public void run() { if (fOperationCode == -1 || fOperationTarget == null) return; ITextEditor editor= getTextEditor(); if (editor == null) return; if (!fRunsOnReadOnly && !validateEditorInputState()) return; Display display= null; IWorkbenchPartSite site= editor.getSite(); Shell shell= site.getShell(); if (shell != null && !shell.isDisposed()) display= shell.getDisplay(); BusyIndicator.showWhile(display, () -> fOperationTarget.doOperation(fOperationCode)); }