/** * @see IWorkingCopy#getOriginal(IJavaElement) * @deprecated */ public IJavaElement getOriginal(IJavaElement workingCopyElement) { // backward compatibility if (!isWorkingCopy()) return null; CompilationUnit cu = (CompilationUnit)workingCopyElement.getAncestor(COMPILATION_UNIT); if (cu == null || !this.owner.equals(cu.owner)) { return null; } return workingCopyElement.getPrimaryElement(); } /**
/** * @see IWorkingCopy#getOriginal(IJavaElement) * @deprecated */ public IJavaElement getOriginal(IJavaElement workingCopyElement) { // backward compatibility if (!isWorkingCopy()) return null; CompilationUnit cu = (CompilationUnit)workingCopyElement.getAncestor(COMPILATION_UNIT); if (cu == null || !this.owner.equals(cu.owner)) { return null; } return workingCopyElement.getPrimaryElement(); } /**
/** * @see IWorkingCopy#getOriginal(IJavaElement) * @deprecated */ public IJavaElement getOriginal(IJavaElement workingCopyElement) { // backward compatibility if (!isWorkingCopy()) return null; CompilationUnit cu = (CompilationUnit)workingCopyElement.getAncestor(COMPILATION_UNIT); if (cu == null || !this.owner.equals(cu.owner)) { return null; } return workingCopyElement.getPrimaryElement(); } /**
/** * @see IWorkingCopy#getOriginal(IJavaElement) * @deprecated */ public IJavaElement getOriginal(IJavaElement workingCopyElement) { // backward compatibility if (!isWorkingCopy()) return null; CompilationUnit cu = (CompilationUnit)workingCopyElement.getAncestor(COMPILATION_UNIT); if (cu == null || !this.owner.equals(cu.owner)) { return null; } return workingCopyElement.getPrimaryElement(); } /**
/** * @see IWorkingCopy#getOriginal(IJavaElement) * @deprecated */ @Override public IJavaElement getOriginal(IJavaElement workingCopyElement) { // backward compatibility if (!isWorkingCopy()) return null; CompilationUnit cu = (CompilationUnit)workingCopyElement.getAncestor(COMPILATION_UNIT); if (cu == null || !this.owner.equals(cu.owner)) { return null; } return workingCopyElement.getPrimaryElement(); } /**
/** * @see IWorkingCopy#getOriginal(IJavaElement) * @deprecated */ public IJavaElement getOriginal(IJavaElement workingCopyElement) { // backward compatibility if (!isWorkingCopy()) return null; CompilationUnit cu = (CompilationUnit)workingCopyElement.getAncestor(COMPILATION_UNIT); if (cu == null || !this.owner.equals(cu.owner)) { return null; } return workingCopyElement.getPrimaryElement(); } /**
private static ISourceRange getOldSourceRange(SearchMatch newMatch) { // cannot transfom offset in preview to offset in original -> just show enclosing method IJavaElement newMatchElement= (IJavaElement) newMatch.getElement(); IJavaElement primaryElement= newMatchElement.getPrimaryElement(); ISourceRange range= null; if (primaryElement.exists() && primaryElement instanceof ISourceReference) { try { range= ((ISourceReference) primaryElement).getSourceRange(); } catch (JavaModelException e) { // can live without source range } } return range; }
private static ISourceRange getOldSourceRange(SearchMatch newMatch) { // cannot transfom offset in preview to offset in original -> just show enclosing method IJavaElement newMatchElement= (IJavaElement) newMatch.getElement(); IJavaElement primaryElement= newMatchElement.getPrimaryElement(); ISourceRange range= null; if (primaryElement.exists() && primaryElement instanceof ISourceReference) { try { range= ((ISourceReference) primaryElement).getSourceRange(); } catch (JavaModelException e) { // can live without source range } } return range; }
private static ISourceRange getOldSourceRange(SearchMatch newMatch) { // cannot transfom offset in preview to offset in original -> just show enclosing method IJavaElement newMatchElement= (IJavaElement) newMatch.getElement(); IJavaElement primaryElement= newMatchElement.getPrimaryElement(); ISourceRange range= null; if (primaryElement.exists() && primaryElement instanceof ISourceReference) { try { range= ((ISourceReference) primaryElement).getSourceRange(); } catch (JavaModelException e) { // can live without source range } } return range; }
private static ISourceRange getOldSourceRange(SearchMatch newMatch) { // cannot transfom offset in preview to offset in original -> just show enclosing method IJavaElement newMatchElement= (IJavaElement) newMatch.getElement(); IJavaElement primaryElement= newMatchElement.getPrimaryElement(); ISourceRange range= null; if (primaryElement.exists() && primaryElement instanceof ISourceReference) { try { range= ((ISourceReference) primaryElement).getSourceRange(); } catch (JavaModelException e) { // can live without source range } } return range; }
postAdjustInputAndSetSelection(((IJavaElement) fInput).getPrimaryElement()); } else postAdjustInputAndSetSelection(null);
postAdjustInputAndSetSelection(((IJavaElement) fInput).getPrimaryElement()); } else postAdjustInputAndSetSelection(null);
postAdjustInputAndSetSelection(((IJavaElement) fInput).getPrimaryElement()); } else postAdjustInputAndSetSelection(null);