@Override public void run() { try { ITextEditor editor= getTextEditor(); if (editor == null) return; if (!validateEditorInputState()) return; Object adapter= editor.getAdapter(IRewriteTarget.class); if (adapter instanceof IRewriteTarget) { IRewriteTarget target= (IRewriteTarget) adapter; IDocument document= target.getDocument(); if (document != null) { Shell shell= getTextEditor().getSite().getShell(); ConvertRunnable runnable= new ConvertRunnable(target, fLineDelimiter); if (document.getNumberOfLines() < 40) { BusyIndicator.showWhile(shell.getDisplay(), runnable); } else { ProgressMonitorDialog dialog= new ProgressMonitorDialog(shell); dialog.run(false, true, runnable); } } } } catch (InterruptedException e) { // action canceled } catch (InvocationTargetException e) { // should not happen } }
public void run() { try { ITextEditor editor= getTextEditor(); if (editor == null) return; if (!validateEditorInputState()) return; Object adapter= editor.getAdapter(IRewriteTarget.class); if (adapter instanceof IRewriteTarget) { IRewriteTarget target= (IRewriteTarget) adapter; IDocument document= target.getDocument(); if (document != null) { Shell shell= getTextEditor().getSite().getShell(); ConvertRunnable runnable= new ConvertRunnable(target, fLineDelimiter); if (document.getNumberOfLines() < 40) { BusyIndicator.showWhile(shell.getDisplay(), runnable); } else { ProgressMonitorDialog dialog= new ProgressMonitorDialog(shell); dialog.run(false, true, runnable); } } } } catch (InterruptedException e) { // action canceled } catch (InvocationTargetException e) { // should not happen } }
@Override public void run() { try { ITextEditor editor= getTextEditor(); if (editor == null) return; if (!validateEditorInputState()) return; Object adapter= editor.getAdapter(IRewriteTarget.class); if (adapter instanceof IRewriteTarget) { IRewriteTarget target= (IRewriteTarget) adapter; IDocument document= target.getDocument(); if (document != null) { Shell shell= getTextEditor().getSite().getShell(); ConvertRunnable runnable= new ConvertRunnable(target, fLineDelimiter); if (document.getNumberOfLines() < 40) { BusyIndicator.showWhile(shell.getDisplay(), runnable); } else { ProgressMonitorDialog dialog= new ProgressMonitorDialog(shell); dialog.run(false, true, runnable); } } } } catch (InterruptedException e) { // action canceled } catch (InvocationTargetException e) { // should not happen } }