Example usage for org.eclipse.jdt.core.dom VariableDeclarationExpression getParent

List of usage examples for org.eclipse.jdt.core.dom VariableDeclarationExpression getParent

Introduction

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

Prototype

public final ASTNode getParent() 

Source Link

Document

Returns this node's parent node, or null if this is the root node.

Usage

From source file:com.bsiag.eclipse.jdt.java.formatter.SpacePreparator.java

License:Open Source License

@Override
public boolean visit(VariableDeclarationExpression node) {
    ASTNode parent = node.getParent();
    if (parent instanceof ForStatement) {
        handleCommas(node.fragments(), this.options.insert_space_before_comma_in_for_inits,
                this.options.insert_space_after_comma_in_for_inits);
    } else if (parent instanceof ExpressionStatement) {
        handleCommas(node.fragments(), this.options.insert_space_before_comma_in_multiple_local_declarations,
                this.options.insert_space_after_comma_in_multiple_local_declarations);
    }//from  w  ww  .  j  a v a 2s .com
    this.tm.firstTokenAfter(node.getType(), -1).spaceBefore();
    return true;
}