Example usage for org.eclipse.jdt.core.dom TypeParameter getStartPosition

List of usage examples for org.eclipse.jdt.core.dom TypeParameter getStartPosition

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.dom TypeParameter getStartPosition.

Prototype

public final int getStartPosition() 

Source Link

Document

Returns the character index into the original source file indicating where the source fragment corresponding to this node begins.

Usage

From source file:com.chookapp.org.bracketeer.jdt.ClosingBracketHintVisitor.java

License:Open Source License

private void addBrackets(List<TypeParameter> typeParameters) throws BadLocationException {
    if (typeParameters == null || typeParameters.isEmpty())
        return;/*from   www  .ja  v  a  2 s  . c  o m*/

    TypeParameter type = typeParameters.get(0);
    int startLoc = type.getStartPosition() - 1;
    type = typeParameters.get(typeParameters.size() - 1);
    int endLoc = type.getStartPosition() + type.getLength();
    _container.add(new BracketsPair(startLoc, '<', endLoc, '>'));
}