@Override public void run(ITextSelection selection) { IJavaElement input= SelectionConverter.getInput(fEditor); if (!ActionUtil.isProcessable(getShell(), input)) return; try { IJavaElement[] elements= SelectionConverter.codeResolveOrInputForked(fEditor); if (elements == null) return; List<IJavaElement> candidates= new ArrayList<>(elements.length); for (int i= 0; i < elements.length; i++) { IJavaElement[] resolvedElements= OpenTypeHierarchyUtil.getCandidates(elements[i]); if (resolvedElements != null) candidates.addAll(Arrays.asList(resolvedElements)); } run(candidates.toArray(new IJavaElement[candidates.size()])); } catch (InvocationTargetException e) { ExceptionHandler.handle(e, getShell(), getDialogTitle(), ActionMessages.SelectionConverter_codeResolve_failed); } catch (InterruptedException e) { // cancelled } }
@Override public void run(ITextSelection selection) { IJavaElement input= SelectionConverter.getInput(fEditor); if (!ActionUtil.isProcessable(getShell(), input)) return; try { IJavaElement[] elements= SelectionConverter.codeResolveOrInputForked(fEditor); if (elements == null) return; List<IJavaElement> candidates= new ArrayList<>(elements.length); for (int i= 0; i < elements.length; i++) { IJavaElement[] resolvedElements= OpenTypeHierarchyUtil.getCandidates(elements[i]); if (resolvedElements != null) candidates.addAll(Arrays.asList(resolvedElements)); } run(candidates.toArray(new IJavaElement[candidates.size()])); } catch (InvocationTargetException e) { ExceptionHandler.handle(e, getShell(), getDialogTitle(), ActionMessages.SelectionConverter_codeResolve_failed); } catch (InterruptedException e) { // cancelled } }
public void run(ITextSelection selection) { IJavaElement input= SelectionConverter.getInput(fEditor); if (!ActionUtil.isProcessable(getShell(), input)) return; try { IJavaElement[] elements= SelectionConverter.codeResolveOrInputForked(fEditor); if (elements == null) return; List candidates= new ArrayList(elements.length); for (int i= 0; i < elements.length; i++) { IJavaElement[] resolvedElements= OpenTypeHierarchyUtil.getCandidates(elements[i]); if (resolvedElements != null) candidates.addAll(Arrays.asList(resolvedElements)); } run((IJavaElement[])candidates.toArray(new IJavaElement[candidates.size()])); } catch (InvocationTargetException e) { ExceptionHandler.handle(e, getShell(), getDialogTitle(), ActionMessages.SelectionConverter_codeResolve_failed); } catch (InterruptedException e) { // cancelled } }
public void run(ITextSelection selection) { IJavaElement input= SelectionConverter.getInput(fEditor); if (!ActionUtil.isProcessable(getShell(), input)) return; try { IJavaElement[] elements= SelectionConverter.codeResolveOrInputForked(fEditor); if (elements == null) return; List candidates= new ArrayList(elements.length); for (int i= 0; i < elements.length; i++) { IJavaElement[] resolvedElements= CallHierarchyUI.getCandidates(elements[i]); if (resolvedElements != null) candidates.addAll(Arrays.asList(resolvedElements)); } if (candidates.isEmpty()) { IJavaElement enclosingMethod= getEnclosingMethod(input, selection); if (enclosingMethod != null) { candidates.add(enclosingMethod); } } run((IJavaElement[])candidates.toArray(new IJavaElement[candidates.size()])); } catch (InvocationTargetException e) { ExceptionHandler.handle(e, getShell(), getErrorDialogTitle(), ActionMessages.SelectionConverter_codeResolve_failed); } catch (InterruptedException e) { // cancelled } }
IJavaElement[] elements= SelectionConverter.codeResolveOrInputForked(fEditor); if (elements == null) return;
IJavaElement[] elements= SelectionConverter.codeResolveOrInputForked(fEditor); if (elements == null) return;
@Override public void run(ITextSelection selection) { IJavaElement element= SelectionConverter.getInput(fEditor); if (!ActionUtil.isProcessable(getShell(), element)) return; try { IJavaElement[] elements= SelectionConverter.codeResolveOrInputForked(fEditor); if (elements == null || elements.length == 0) return; IJavaElement candidate= elements[0]; if (elements.length > 1) { candidate= SelectionConverter.selectJavaElement(elements, getShell(), getDialogTitle(), ActionMessages.OpenAttachedJavadocAction_select_element); } if (candidate != null) { run(candidate); } } catch (InvocationTargetException e) { ExceptionHandler.handle(e, getShell(), getDialogTitle(), ActionMessages.OpenAttachedJavadocAction_code_resolve_failed); } catch (InterruptedException e) { // cancelled } }
public void run(ITextSelection selection) { IJavaElement input= SelectionConverter.getInput(fEditor); if (!ActionUtil.isProcessable(getShell(), input)) return; try { IJavaElement[] elements= SelectionConverter.codeResolveOrInputForked(fEditor); if (elements == null || elements.length == 0) return; IJavaElement candidate= elements[0]; if (elements.length > 1) { candidate= SelectionConverter.selectJavaElement(elements, getShell(), getDialogTitle(), ActionMessages.ShowInNavigatorView_dialog_message); } if (candidate != null) { run(getResource(candidate)); } } catch (InvocationTargetException e) { ExceptionHandler.handle(e, getDialogTitle(), ActionMessages.SelectionConverter_codeResolve_failed); } catch (InterruptedException e) { // cancelled } }
public void run(ITextSelection selection) { IJavaElement element= SelectionConverter.getInput(fEditor); if (!ActionUtil.isProcessable(getShell(), element)) return; try { IJavaElement[] elements= SelectionConverter.codeResolveOrInputForked(fEditor); if (elements == null || elements.length == 0) return; IJavaElement candidate= elements[0]; if (elements.length > 1) { candidate= SelectionConverter.selectJavaElement(elements, getShell(), getDialogTitle(), ActionMessages.OpenExternalJavadocAction_select_element); } if (candidate != null) { run(candidate); } } catch (InvocationTargetException e) { ExceptionHandler.handle(e, getShell(), getDialogTitle(), ActionMessages.OpenExternalJavadocAction_code_resolve_failed); } catch (InterruptedException e) { // cancelled } }
@Override public void run(ITextSelection selection) { IJavaElement input= SelectionConverter.getInput(fEditor); if (!ActionUtil.isProcessable(getShell(), input)) return; try { IJavaElement[] elements= SelectionConverter.codeResolveOrInputForked(fEditor); if (elements == null || elements.length == 0) return; IJavaElement candidate= elements[0]; if (elements.length > 1) { candidate= SelectionConverter.selectJavaElement(elements, getShell(), getDialogTitle(), ActionMessages.ShowInNavigatorView_dialog_message); } if (candidate != null) { run(getResource(candidate)); } } catch (InvocationTargetException e) { ExceptionHandler.handle(e, getDialogTitle(), ActionMessages.SelectionConverter_codeResolve_failed); } catch (InterruptedException e) { // cancelled } }
@Override public void run(ITextSelection selection) { IJavaElement input= SelectionConverter.getInput(fEditor); if (!ActionUtil.isProcessable(getShell(), input)) return; try { IJavaElement[] elements= SelectionConverter.codeResolveOrInputForked(fEditor); if (elements == null || elements.length == 0) return; IJavaElement candidate= elements[0]; if (elements.length > 1) { candidate= SelectionConverter.selectJavaElement(elements, getShell(), getDialogTitle(), ActionMessages.ShowInNavigatorView_dialog_message); } if (candidate != null) { run(getResource(candidate)); } } catch (InvocationTargetException e) { ExceptionHandler.handle(e, getDialogTitle(), ActionMessages.SelectionConverter_codeResolve_failed); } catch (InterruptedException e) { // cancelled } }
@Override public void run(ITextSelection selection) { IJavaElement element= SelectionConverter.getInput(fEditor); if (!ActionUtil.isProcessable(getShell(), element)) return; try { IJavaElement[] elements= SelectionConverter.codeResolveOrInputForked(fEditor); if (elements == null || elements.length == 0) return; IJavaElement candidate= elements[0]; if (elements.length > 1) { candidate= SelectionConverter.selectJavaElement(elements, getShell(), getDialogTitle(), ActionMessages.OpenAttachedJavadocAction_select_element); } if (candidate != null) { run(candidate); } } catch (InvocationTargetException e) { ExceptionHandler.handle(e, getShell(), getDialogTitle(), ActionMessages.OpenAttachedJavadocAction_code_resolve_failed); } catch (InterruptedException e) { // cancelled } }