@Override public void run(IStructuredSelection selection) { run(getResource(selection)); }
@Override public void selectionChanged(IStructuredSelection selection) { setEnabled(getResource(selection) != null); }
@Override public void run(IStructuredSelection selection) { run(getResource(selection)); }
@Override public void selectionChanged(IStructuredSelection selection) { setEnabled(getResource(selection) != null); }
public void selectionChanged(IStructuredSelection selection) { setEnabled(getResource(selection) != null); }
public void run(IStructuredSelection selection) { run(getResource(selection)); }
private IResource getResource(IStructuredSelection selection) { if (selection.size() != 1) return null; Object element= selection.getFirstElement(); if (element instanceof IResource) return (IResource)element; if (element instanceof IJavaElement) return getResource((IJavaElement)element); return null; }
private IResource getResource(IStructuredSelection selection) { if (selection.size() != 1) return null; Object element= selection.getFirstElement(); if (element instanceof IResource) return (IResource)element; if (element instanceof IJavaElement) return getResource((IJavaElement)element); return null; }
private IResource getResource(IStructuredSelection selection) { if (selection.size() != 1) return null; Object element= selection.getFirstElement(); if (element instanceof IResource) return (IResource)element; if (element instanceof IJavaElement) return getResource((IJavaElement)element); return null; }
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 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 } }