public static CallHierarchyViewPart open(IJavaElement[] candidates, IWorkbenchWindow window) { Assert.isTrue(candidates != null && candidates.length != 0); IJavaElement input= null; if (candidates.length > 1) { String title= CallHierarchyMessages.CallHierarchyUI_selectionDialog_title; String message= CallHierarchyMessages.CallHierarchyUI_selectionDialog_message; input= SelectionConverter.selectJavaElement(candidates, window.getShell(), title, message); } else { input= candidates[0]; } if (input == null) return null; return openInViewPart(window, input); }
public static CallHierarchyViewPart openSelectionDialog(IMember[] candidates, IWorkbenchWindow window) { Assert.isTrue(candidates != null); IMember input= null; if (candidates.length > 1) { String title= CallHierarchyMessages.CallHierarchyUI_selectionDialog_title; String message= CallHierarchyMessages.CallHierarchyUI_selectionDialog_message; input= (IMember) SelectionConverter.selectJavaElement(candidates, window.getShell(), title, message); } else if (candidates.length == 1) { input= candidates[0]; } if (input == null) return openView(new IMember[] {}, window); return openView(new IMember[] { input }, window); }
public static CallHierarchyViewPart openSelectionDialog(IMember[] candidates, IWorkbenchWindow window) { Assert.isTrue(candidates != null); IMember input= null; if (candidates.length > 1) { String title= CallHierarchyMessages.CallHierarchyUI_selectionDialog_title; String message= CallHierarchyMessages.CallHierarchyUI_selectionDialog_message; input= (IMember) SelectionConverter.selectJavaElement(candidates, window.getShell(), title, message); } else if (candidates.length == 1) { input= candidates[0]; } if (input == null) return openView(new IMember[] {}, window); return openView(new IMember[] { input }, window); }
IJavaElement element= SelectionConverter.selectJavaElement(types.toArray(new IType[types.size()]), fOpenAction.getShell(), ActionMessages.OpenAction_error_title, ActionMessages.OpenAction_select_element); if (element != null) { fOpenAction.run(new StructuredSelection(element));
public void run(ITextSelection selection) { if (!ActionUtil.isProcessable(fEditor)) return; try { String title= SearchMessages.SearchElementSelectionDialog_title; String message= SearchMessages.SearchElementSelectionDialog_message; IJavaElement[] elements= SelectionConverter.codeResolveForked(fEditor, true); if (elements.length > 0 && canOperateOn(elements[0])) { IJavaElement element= elements[0]; if (elements.length > 1) element= SelectionConverter.selectJavaElement(elements, getShell(), title, message); if (element != null) run(element); } else showOperationUnavailableDialog(); } catch (InvocationTargetException ex) { String title= SearchMessages.Search_Error_search_title; String message= SearchMessages.Search_Error_codeResolve; ExceptionHandler.handle(ex, getShell(), title, message); } catch (InterruptedException e) { // ignore } }
@Override public void run(ITextSelection selection) { if (!ActionUtil.isProcessable(fEditor)) return; try { String title= SearchMessages.SearchElementSelectionDialog_title; String message= SearchMessages.SearchElementSelectionDialog_message; IJavaElement[] elements= SelectionConverter.codeResolveForked(fEditor, true); if (elements.length > 0 && canOperateOn(elements[0])) { IJavaElement element= elements[0]; if (elements.length > 1) element= SelectionConverter.selectJavaElement(elements, getShell(), title, message); if (element != null) run(element); } else showOperationUnavailableDialog(); } catch (InvocationTargetException ex) { String title= SearchMessages.Search_Error_search_title; String message= SearchMessages.Search_Error_codeResolve; ExceptionHandler.handle(ex, getShell(), title, message); } catch (InterruptedException e) { // ignore } }
@Override public void run(ITextSelection selection) { if (!ActionUtil.isProcessable(fEditor)) return; try { String title= SearchMessages.SearchElementSelectionDialog_title; String message= SearchMessages.SearchElementSelectionDialog_message; IJavaElement[] elements= SelectionConverter.codeResolveForked(fEditor, true); if (elements.length > 0 && canOperateOn(elements[0])) { IJavaElement element= elements[0]; if (elements.length > 1) element= SelectionConverter.selectJavaElement(elements, getShell(), title, message); if (element != null) run(element); } else showOperationUnavailableDialog(); } catch (InvocationTargetException ex) { String title= SearchMessages.Search_Error_search_title; String message= SearchMessages.Search_Error_codeResolve; ExceptionHandler.handle(ex, getShell(), title, message); } catch (InterruptedException e) { // ignore } }
String title= JavaUIMessages.OpenTypeHierarchyUtil_selectionDialog_title; String message= JavaUIMessages.OpenTypeHierarchyUtil_selectionDialog_message; input= SelectionConverter.selectJavaElement(candidates, window.getShell(), title, message); } else { input= candidates[0];
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 } }
@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 } }
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 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 } }
@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 } }
public void run(ITextSelection selection) { if (!isProcessable()) return; try { IJavaElement[] elements= SelectionConverter.codeResolveForked(fEditor, false); if (elements == null || elements.length == 0) { IEditorStatusLine statusLine= (IEditorStatusLine) fEditor.getAdapter(IEditorStatusLine.class); if (statusLine != null) statusLine.setMessage(true, ActionMessages.OpenAction_error_messageBadSelection, null); getShell().getDisplay().beep(); return; } IJavaElement element= elements[0]; if (elements.length > 1) { element= SelectionConverter.selectJavaElement(elements, getShell(), getDialogTitle(), ActionMessages.OpenAction_select_element); if (element == null) return; } int type= element.getElementType(); if (type == IJavaElement.JAVA_PROJECT || type == IJavaElement.PACKAGE_FRAGMENT_ROOT || type == IJavaElement.PACKAGE_FRAGMENT) element= EditorUtility.getEditorInputJavaElement(fEditor, false); run(new Object[] {element} ); } catch (InvocationTargetException e) { ExceptionHandler.handle(e, getShell(), getDialogTitle(), ActionMessages.OpenAction_error_message); } catch (InterruptedException e) { // ignore } }
element = elements[0]; if (elements.length > 1) element= SelectionConverter.selectJavaElement(elements, getShell(), getDialogTitle(), ActionMessages.OpenAction_select_element);
element= SelectionConverter.selectJavaElement(elements, getShell(), getDialogTitle(), ActionMessages.OpenAction_select_element); if (element == null) return;
if (elements.length > 1) { if (needsUserSelection(elements, input)) { element= SelectionConverter.selectJavaElement(elements, getShell(), getDialogTitle(), ActionMessages.OpenAction_select_element); if (element == null) return;