Example usage for org.eclipse.jdt.internal.compiler.env ISourceType getNameSourceStart

List of usage examples for org.eclipse.jdt.internal.compiler.env ISourceType getNameSourceStart

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.compiler.env ISourceType getNameSourceStart.

Prototype

int getNameSourceStart();

Source Link

Document

Answer the source start position of the type's name.

Usage

From source file:org.eclipse.ajdt.core.javaelements.ITDAwareSourceTypeInfo.java

License:Open Source License

public ITDAwareSourceTypeInfo(ISourceType toCopy, SourceType type) {
    this.handle = createITDAwareType(type, this);

    this.setFlags(toCopy.getModifiers());
    this.setSuperclassName(toCopy.getSuperclassName());
    this.setSuperInterfaceNames(toCopy.getInterfaceNames());
    this.setNameSourceEnd(toCopy.getNameSourceEnd());
    this.setNameSourceStart(toCopy.getNameSourceStart());
    this.setSourceRangeEnd(toCopy.getDeclarationSourceEnd());
    this.setSourceRangeStart(toCopy.getDeclarationSourceStart());
    try {//from  ww  w  . j  a v a 2s  .c o  m
        ITypeParameter[] parameters = type.getTypeParameters();
        if (parameters != null) {
            this.typeParameters = new ITypeParameter[parameters.length];
            System.arraycopy(parameters, 0, this.typeParameters, 0, parameters.length);
        }
    } catch (JavaModelException e) {
    }

    IJavaElement[] children = augmentChildrenAndHierarchy(type);
    if (children != null) {
        this.setChildren(children);
    }

    try {
        // this ensures that itd aware content assist 
        // still works when there are large numbers ofannotations
        Object info = ((JavaElement) handle.getCompilationUnit()).getElementInfo();
        if (info != null && info instanceof CompilationUnitElementInfo) {
            ((CompilationUnitElementInfo) info).annotationNumber = 0;
        }
    } catch (JavaModelException e) {
    }
}