Example usage for org.eclipse.jdt.internal.core SourceMapper getNameRange

List of usage examples for org.eclipse.jdt.internal.core SourceMapper getNameRange

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.core SourceMapper getNameRange.

Prototype

public SourceRange getNameRange(IJavaElement element) 

Source Link

Document

Returns the SourceRange for the name of the given element, or {-1, -1} if no source range is known for the name of the element.

Usage

From source file:com.codenvy.ide.ext.java.server.internal.core.BinaryMember.java

License:Open Source License

public ISourceRange getNameRange() throws JavaModelException {
    SourceMapper mapper = getSourceMapper();
    if (mapper != null) {
        // ensure the class file's buffer is open so that source ranges are computed
        ((ClassFile) getClassFile()).getBuffer();

        return mapper.getNameRange(this);
    } else {// ww w  .j a  v  a  2s. c o  m
        return SourceMapper.UNKNOWN_RANGE;
    }
}