Type varDeclType = varDeclStmt.getType();
if (varDeclType instanceof SimpleType) {
SimpleType sType = (SimpleType) varDeclType;
parentNode = parentNode.getParent();
if (parentNode instanceof Block) {
Block block = (Block) parentNode;
try {
if (viewer.getDocument().getChar(block.getStartPosition()) != '{') {
parentNode = parentNode.getParent();
if (parentNode instanceof MethodDeclaration) {
MethodDeclaration methodDecl = (MethodDeclaration) parentNode;
return getProposals(methodDecl, sType.getName()
.getFullyQualifiedName(), invocationOffset,
varDeclStmt, javaContext);
}
}
}
catch (BadLocationException e) {
StatusHandler.log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, e
.getMessage(), e));
}
}
}
}
}
// cursor is at the start of a param type
else if (parentNode instanceof SimpleType) {
SimpleType sType = (SimpleType) parentNode;
parentNode = sType.getParent();
if (parentNode instanceof SingleVariableDeclaration) {
SingleVariableDeclaration varDecl = (SingleVariableDeclaration) parentNode;
parentNode = varDecl.getParent();
if (parentNode instanceof MethodDeclaration) {
MethodDeclaration methodDecl = (MethodDeclaration) parentNode;
return getProposals(methodDecl, sType.getName().getFullyQualifiedName(),
invocationOffset, sType, javaContext);
}
}
}
}
// param at the end of a method param list
// [method(param,
// w^)]
else if (node instanceof Block) {
Block block = (Block) node;
ASTNode parentNode = block.getParent();
if (parentNode instanceof MethodDeclaration) {
MethodDeclaration methodDecl = (MethodDeclaration) parentNode;
try {
String blockContent = viewer.getDocument().get(block.getStartPosition(),
block.getLength());
if (blockContent.startsWith(",")) {
blockContent = blockContent.substring(1);
boolean isAnnotation = false;
while (blockContent.length() > 0) {