if (editor == null || editor.getCachedSelectedRange() == null) return false; // can't compute IJavaElement elem= SelectionConverter.getElementAtOffset(ast.getTypeRoot(), new TextSelection(editor.getCachedSelectedRange().x, editor.getCachedSelectedRange().y)); if (!(elem instanceof IImportDeclaration)) return false; caretLine= document.getLineOfOffset(editor.getCachedSelectedRange().x) + 1; } catch (BadLocationException x) { return false; // can't compute
if (editor == null || editor.getCachedSelectedRange() == null) return false; // can't compute IJavaElement elem= SelectionConverter.getElementAtOffset(ast.getTypeRoot(), new TextSelection(editor.getCachedSelectedRange().x, editor.getCachedSelectedRange().y)); if (!(elem instanceof IImportDeclaration)) return false; caretLine= document.getLineOfOffset(editor.getCachedSelectedRange().x) + 1; } catch (BadLocationException x) { return false; // can't compute
if (editor == null || editor.getCachedSelectedRange() == null) return false; // can't compute IJavaElement elem= SelectionConverter.getElementAtOffset(ast.getJavaElement(), new TextSelection(editor.getCachedSelectedRange().x, editor.getCachedSelectedRange().y)); if (!(elem instanceof IImportDeclaration)) return false; caretLine= document.getLineOfOffset(editor.getCachedSelectedRange().x) + 1; } catch (BadLocationException x) { return false; // can't compute