private String getSourceFileName() { if (this.sourceFileName != null) return this.sourceFileName; this.sourceFileName = NO_SOURCE_FILE_NAME; if (this.openable.getSourceMapper() != null) { BinaryType type = (BinaryType) ((ClassFile) this.openable).getType(); ClassFileReader reader = MatchLocator.classFileReader(type); if (reader != null) { String fileName = type.sourceFileName(reader); this.sourceFileName = fileName == null ? NO_SOURCE_FILE_NAME : fileName; } } return this.sourceFileName; } boolean hasSimilarMatch() {
private String getSourceFileName() { if (this.sourceFileName != null) return this.sourceFileName; this.sourceFileName = NO_SOURCE_FILE_NAME; if (this.openable.getSourceMapper() != null) { BinaryType type = (BinaryType) ((ClassFile) this.openable).getType(); ClassFileReader reader = MatchLocator.classFileReader(type); if (reader != null) { String fileName = type.sourceFileName(reader); this.sourceFileName = fileName == null ? NO_SOURCE_FILE_NAME : fileName; } } return this.sourceFileName; } boolean hasSimilarMatch() {
private String getSourceFileName() { if (this.sourceFileName != null) return this.sourceFileName; this.sourceFileName = NO_SOURCE_FILE_NAME; if (this.openable.getSourceMapper() != null) { BinaryType type = (BinaryType) ((ClassFile) this.openable).getType(); ClassFileReader reader = MatchLocator.classFileReader(type); if (reader != null) { String fileName = type.sourceFileName(reader); this.sourceFileName = fileName == null ? NO_SOURCE_FILE_NAME : fileName; } } return this.sourceFileName; } boolean hasSimilarMatch() {
private String getSourceFileName() { if (this.sourceFileName != null) return this.sourceFileName; this.sourceFileName = NO_SOURCE_FILE_NAME; if (this.openable.getSourceMapper() != null) { BinaryType type = (BinaryType) ((ClassFile) this.openable).getType(); ClassFileReader reader = MatchLocator.classFileReader(type); if (reader != null) { String fileName = type.sourceFileName(reader); this.sourceFileName = fileName == null ? NO_SOURCE_FILE_NAME : fileName; } } return this.sourceFileName; } boolean hasSimilarMatch() {
@Override public void codeComplete(int offset, CompletionRequestor requestor, WorkingCopyOwner owner, IProgressMonitor monitor) throws JavaModelException { String source = getSource(); if (source != null) { BinaryType type = (BinaryType) getType(); BasicCompilationUnit cu = new BasicCompilationUnit( getSource().toCharArray(), null, type.sourceFileName((IBinaryType) type.getElementInfo()), getJavaProject()); // use project to retrieve corresponding .java IFile codeComplete(cu, cu, offset, requestor, owner, null/*extended context isn't computed*/, monitor); } }
public void codeComplete(int offset, CompletionRequestor requestor, WorkingCopyOwner owner, IProgressMonitor monitor) throws JavaModelException { String source = getSource(); if (source != null) { BinaryType type = (BinaryType) getType(); BasicCompilationUnit cu = new BasicCompilationUnit( getSource().toCharArray(), null, type.sourceFileName((IBinaryType) type.getElementInfo()), getJavaProject()); // use project to retrieve corresponding .java IFile codeComplete(cu, cu, offset, requestor, owner, null/*extended context isn't computed*/, monitor); } }
public void codeComplete(int offset, CompletionRequestor requestor, WorkingCopyOwner owner, IProgressMonitor monitor) throws JavaModelException { String source = getSource(); if (source != null) { BinaryType type = (BinaryType) getType(); BasicCompilationUnit cu = new BasicCompilationUnit( getSource().toCharArray(), null, type.sourceFileName((IBinaryType) type.getElementInfo()), getJavaProject()); // use project to retrieve corresponding .java IFile codeComplete(cu, cu, offset, requestor, owner, null/*extended context isn't computed*/, monitor); } }
public void codeComplete(int offset, CompletionRequestor requestor, WorkingCopyOwner owner, IProgressMonitor monitor) throws JavaModelException { String source = getSource(); if (source != null) { BinaryType type = (BinaryType) getType(); BasicCompilationUnit cu = new BasicCompilationUnit( getSource().toCharArray(), null, type.sourceFileName((IBinaryType) type.getElementInfo()), getJavaProject()); // use project to retrieve corresponding .java IFile codeComplete(cu, cu, offset, requestor, owner, null/*extended context isn't computed*/, monitor); } }
public void codeComplete(int offset, CompletionRequestor requestor, WorkingCopyOwner owner, IProgressMonitor monitor) throws JavaModelException { String source = getSource(); if (source != null) { BinaryType type = (BinaryType) getType(); BasicCompilationUnit cu = new BasicCompilationUnit( getSource().toCharArray(), null, type.sourceFileName((IBinaryType) type.getElementInfo()), getJavaProject()); // use project to retrieve corresponding .java IFile codeComplete(cu, cu, offset, requestor, owner, null/*extended context isn't computed*/, monitor); } }
public void codeComplete(int offset, CompletionRequestor requestor, WorkingCopyOwner owner, IProgressMonitor monitor) throws JavaModelException { String source = getSource(); if (source != null) { BinaryType type = (BinaryType) getType(); BasicCompilationUnit cu = new BasicCompilationUnit( getSource().toCharArray(), null, type.sourceFileName((IBinaryType) type.getElementInfo()), getJavaProject()); // use project to retrieve corresponding .java IFile codeComplete(cu, cu, offset, requestor, owner, null/*extended context isn't computed*/, monitor); } }
public String getSourceFileName(IBinaryType info) { if (info == null) { try { info = (IBinaryType) getElementInfo(); } catch (JavaModelException e) { // default to using the outer most declaring type name IType type = this; IType enclosingType = getDeclaringType(); while (enclosingType != null) { type = enclosingType; enclosingType = type.getDeclaringType(); } return type.getElementName() + Util.defaultJavaExtension(); } } return sourceFileName(info); }
public String getSourceFileName(IBinaryType info) { if (info == null) { try { info = (IBinaryType) getElementInfo(); } catch (JavaModelException e) { // default to using the outer most declaring type name IType type = this; IType enclosingType = getDeclaringType(); while (enclosingType != null) { type = enclosingType; enclosingType = type.getDeclaringType(); } return type.getElementName() + Util.defaultJavaExtension(); } } return sourceFileName(info); }
public String getSourceFileName(IBinaryType info) { if (info == null) { try { info = (IBinaryType) getElementInfo(); } catch (JavaModelException e) { // default to using the outer most declaring type name IType type = this; IType enclosingType = getDeclaringType(); while (enclosingType != null) { type = enclosingType; enclosingType = type.getDeclaringType(); } return type.getElementName() + Util.defaultJavaExtension(); } } return sourceFileName(info); }
public String getSourceFileName(IBinaryType info) { if (info == null) { try { info = (IBinaryType) getElementInfo(); } catch (JavaModelException e) { // default to using the outer most declaring type name IType type = this; IType enclosingType = getDeclaringType(); while (enclosingType != null) { type = enclosingType; enclosingType = type.getDeclaringType(); } return type.getElementName() + Util.defaultJavaExtension(); } } return sourceFileName(info); }
/** * @see ICodeAssist#codeSelect(int, int, WorkingCopyOwner) */ public IJavaElement[] codeSelect(int offset, int length, WorkingCopyOwner owner) throws JavaModelException { IBuffer buffer = getBuffer(); char[] contents; if (buffer != null && (contents = buffer.getCharacters()) != null) { BinaryType type = (BinaryType) getType(); BasicCompilationUnit cu = new BasicCompilationUnit(contents, null, type.sourceFileName((IBinaryType) type.getElementInfo())); return super.codeSelect(cu, offset, length, owner); } else { //has no associated souce return new IJavaElement[] {}; } } /**
/** * @see ICodeAssist#codeSelect(int, int, WorkingCopyOwner) */ public IJavaElement[] codeSelect(int offset, int length, WorkingCopyOwner owner) throws JavaModelException { IBuffer buffer = getBuffer(); char[] contents; if (buffer != null && (contents = buffer.getCharacters()) != null) { BinaryType type = (BinaryType) getType(); BasicCompilationUnit cu = new BasicCompilationUnit(contents, null, type.sourceFileName((IBinaryType) type.getElementInfo())); return super.codeSelect(cu, offset, length, owner); } else { //has no associated souce return new IJavaElement[] {}; } } /**
/** * @see ICodeAssist#codeSelect(int, int, WorkingCopyOwner) */ public IJavaElement[] codeSelect(int offset, int length, WorkingCopyOwner owner) throws JavaModelException { IBuffer buffer = getBuffer(); char[] contents; if (buffer != null && (contents = buffer.getCharacters()) != null) { BinaryType type = (BinaryType) getType(); BasicCompilationUnit cu = new BasicCompilationUnit(contents, null, type.sourceFileName((IBinaryType) type.getElementInfo()), this); return super.codeSelect(cu, offset, length, owner); } else { //has no associated souce return new IJavaElement[] {}; } } public boolean existsUsingJarTypeCache() {
/** * @see ICodeAssist#codeSelect(int, int, WorkingCopyOwner) */ public IJavaElement[] codeSelect(int offset, int length, WorkingCopyOwner owner) throws JavaModelException { IBuffer buffer = getBuffer(); char[] contents; if (buffer != null && (contents = buffer.getCharacters()) != null) { BinaryType type = (BinaryType) getType(); BasicCompilationUnit cu = new BasicCompilationUnit(contents, null, type.sourceFileName((IBinaryType) type.getElementInfo())); return super.codeSelect(cu, offset, length, owner); } else { //has no associated souce return new IJavaElement[] {}; } } /**
/** * @see ICodeAssist#codeSelect(int, int, WorkingCopyOwner) */ @Override public IJavaElement[] codeSelect(int offset, int length, WorkingCopyOwner owner) throws JavaModelException { IBuffer buffer = getBuffer(); char[] contents; if (buffer != null && (contents = buffer.getCharacters()) != null) { BinaryType type = (BinaryType) getType(); BasicCompilationUnit cu = new BasicCompilationUnit(contents, null, type.sourceFileName((IBinaryType) type.getElementInfo()), this); return super.codeSelect(cu, offset, length, owner); } else { //has no associated souce return new IJavaElement[] {}; } } public boolean existsUsingJarTypeCache() {
protected void reportBinaryMemberDeclaration(IResource resource, IMember binaryMember, Binding binaryMemberBinding, IBinaryType info, int accuracy) throws CoreException { ClassFile classFile = (ClassFile) binaryMember.getClassFile(); ISourceRange range = classFile.isOpen() ? binaryMember.getNameRange() : SourceMapper.UNKNOWN_RANGE; if (range.getOffset() == -1) { BinaryType type = (BinaryType) classFile.getType(); String sourceFileName = type.sourceFileName(info); if (sourceFileName != null) { SourceMapper mapper = classFile.getSourceMapper(); if (mapper != null) { char[] contents = mapper.findSource(type, sourceFileName); if (contents != null) range = mapper.mapSource(type, contents, info, binaryMember); } } } if (resource == null) resource = this.currentPossibleMatch.resource; SearchMatch match = newDeclarationMatch(binaryMember, binaryMemberBinding, accuracy, range.getOffset(), range.getLength(), getParticipant(), resource); report(match); }