public static boolean isEditable(JavaEditor editor) { if (! isProcessable(editor)) return false; return editor.validateEditorInputState(); }
public static boolean isEditable(JavaEditor editor) { if (! isProcessable(editor)) return false; return editor.validateEditorInputState(); }
public static boolean isEditable(JavaEditor editor) { if (! isProcessable(editor)) return false; return editor.validateEditorInputState(); }
/** * Executes this action for the given java element. * @param element The java element to be found. */ public void run(IJavaElement element) { if (!ActionUtil.isProcessable(getShell(), element)) return; run(new IJavaElement[] {element}); }
private boolean isProcessable() { if (fEditor != null) { IJavaElement je= EditorUtility.getEditorInputJavaElement(fEditor, false); if (je instanceof ICompilationUnit && !JavaModelUtil.isPrimary((ICompilationUnit)je)) return true; // can process non-primary working copies } return ActionUtil.isProcessable(fEditor); }
/** * Executes this action for the given java element. * @param element The java element to be found. */ public void run(IJavaElement element) { if (!ActionUtil.isProcessable(getShell(), element)) return; run(new IJavaElement[] {element}); }
@Override public void run(IStructuredSelection selection) { if (!canEnableFor(selection)) return; IJavaElement element= (IJavaElement)selection.getFirstElement(); if (!ActionUtil.isProcessable(getShell(), element)) return; run(element); }
@Override public void run(IStructuredSelection selection) { if (!canEnableFor(selection)) return; IJavaElement element= (IJavaElement)selection.getFirstElement(); if (!ActionUtil.isProcessable(getShell(), element)) return; run(element); }
public void run(IStructuredSelection selection) { if (!checkEnabled(selection)) return; IJavaElement element= (IJavaElement)selection.getFirstElement(); if (!ActionUtil.isProcessable(getShell(), element)) return; run(element); }
@Override public void run(ITextSelection selection) { if (!ActionUtil.isProcessable(fEditor)) return; IJavaElement element= elementAtOffset(); if (element == null || !(element instanceof IMethod)) { MessageDialog.openInformation(getShell(), getDialogTitle(), ActionMessages.OpenSuperImplementationAction_not_applicable); return; } run((IMethod) element); }
public void run(ITextSelection selection) { if (!ActionUtil.isProcessable(fEditor)) return; IJavaElement element= elementAtOffset(); if (element == null || !(element instanceof IMethod)) { MessageDialog.openInformation(getShell(), getDialogTitle(), ActionMessages.OpenSuperImplementationAction_not_applicable); return; } run((IMethod) element); }
@Override public void run(ITextSelection selection) { if (!ActionUtil.isProcessable(fEditor)) return; IJavaElement element= elementAtOffset(); if (element == null || !(element instanceof IMethod)) { MessageDialog.openInformation(getShell(), getDialogTitle(), ActionMessages.OpenSuperImplementationAction_not_applicable); return; } run((IMethod) element); }
@Override public void run(ITextSelection selection) { ITypeRoot typeRoot= SelectionConverter.getInput(fEditor); if (ActionUtil.isProcessable(getShell(), typeRoot)) { RefactoringExecutionStarter.startReplaceInvocationsRefactoring(typeRoot, selection.getOffset(), selection.getLength(), getShell()); } } }
@Override public void run(ITextSelection selection) { ITypeRoot typeRoot= SelectionConverter.getInput(fEditor); if (ActionUtil.isProcessable(getShell(), typeRoot)) { RefactoringExecutionStarter.startReplaceInvocationsRefactoring(typeRoot, selection.getOffset(), selection.getLength(), getShell()); } } }
public void run(ITextSelection selection) { try { IJavaElement editorInput= SelectionConverter.getInput(fEditor); if ((editorInput instanceof ITypeRoot) && ActionUtil.isProcessable(getShell(), editorInput)) { ITypeRoot typeRoot= (ITypeRoot) editorInput; RefactoringExecutionStarter.startReplaceInvocationsRefactoring(typeRoot, selection.getOffset(), selection.getLength(), getShell()); } } catch (JavaModelException e) { handleException(e); } } }
public void run(IStructuredSelection selection) { try { Assert.isTrue(RefactoringAvailabilityTester.isReplaceInvocationsAvailable(selection)); Object first= selection.getFirstElement(); Assert.isTrue(first instanceof IMethod); IMethod method= (IMethod) first; if (ActionUtil.isProcessable(getShell(), method)) RefactoringExecutionStarter.startReplaceInvocationsRefactoring(method, getShell()); } catch (CoreException e) { handleException(e); } }
@Override public void run(ITextSelection selection) { if (!ActionUtil.isProcessable(fEditor)) return; ITypeRoot editorInput= SelectionConverter.getInput(fEditor); if (!ActionUtil.isEditable(getShell(), editorInput)) return; if (editorInput instanceof ICompilationUnit) run(selection.getOffset(), selection.getLength(), (ICompilationUnit) editorInput); else if (editorInput instanceof IClassFile) run(selection.getOffset(), selection.getLength(), (IClassFile) editorInput); }
@Override public void run(ITextSelection selection) { if (!ActionUtil.isProcessable(fEditor)) return; ITypeRoot editorInput= SelectionConverter.getInput(fEditor); if (!ActionUtil.isEditable(getShell(), editorInput)) return; if (editorInput instanceof ICompilationUnit) run(selection.getOffset(), selection.getLength(), (ICompilationUnit) editorInput); else if (editorInput instanceof IClassFile) run(selection.getOffset(), selection.getLength(), (IClassFile) editorInput); }
public final void run(ITextSelection ts) { IJavaElement input= getEditorInput(fEditor); if (!ActionUtil.isProcessable(getShell(), input)) return; FindOccurrencesEngine engine= FindOccurrencesEngine.create(input, new ExceptionOccurrencesFinder()); try { String result= engine.run(ts.getOffset(), ts.getLength()); if (result != null) showMessage(getShell(), fEditor, result); } catch (JavaModelException e) { JavaPlugin.log(e); } }
public final void run(ITextSelection ts) { IJavaElement input= getEditorInput(fEditor); if (!ActionUtil.isProcessable(getShell(), input)) return; FindOccurrencesEngine engine= FindOccurrencesEngine.create(input, new ImplementOccurrencesFinder()); try { String result= engine.run(ts.getOffset(), ts.getLength()); if (result != null) showMessage(getShell(), fEditor, result); } catch (JavaModelException e) { JavaPlugin.log(e); } }