@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(IStructuredSelection selection) { if (selection.size() != 1) return; Object input= selection.getFirstElement(); if (input instanceof LogicalPackage) { IPackageFragment[] fragments= ((LogicalPackage)input).getFragments(); if (fragments.length == 0) return; input= fragments[0]; } if (!(input instanceof IJavaElement)) { IStatus status= createStatus(ActionMessages.OpenTypeHierarchyAction_messages_no_java_element); ErrorDialog.openError(getShell(), getDialogTitle(), ActionMessages.OpenTypeHierarchyAction_messages_title, status); return; } IJavaElement element= (IJavaElement) input; if (!ActionUtil.isProcessable(getShell(), element)) return; List result= new ArrayList(1); IStatus status= compileCandidates(result, element); if (status.isOK()) { run((IJavaElement[]) result.toArray(new IJavaElement[result.size()])); } else { ErrorDialog.openError(getShell(), getDialogTitle(), ActionMessages.OpenTypeHierarchyAction_messages_title, status); } }
ErrorDialog.openError(getShell(), getDialogTitle(), ActionMessages.OpenTypeHierarchyAction_messages_title, status); return; run(result.toArray(new IJavaElement[result.size()])); } else { ErrorDialog.openError(getShell(), getDialogTitle(), ActionMessages.OpenTypeHierarchyAction_messages_title, status);
ErrorDialog.openError(getShell(), getDialogTitle(), ActionMessages.OpenTypeHierarchyAction_messages_title, status); return; run(result.toArray(new IJavaElement[result.size()])); } else { ErrorDialog.openError(getShell(), getDialogTitle(), ActionMessages.OpenTypeHierarchyAction_messages_title, status);