Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: IBM Corporation - initial API and implementation /
package org.eclipse.jdt.internal.codeassist.complete;
/*
 * Completion node build by the parser in any case it was intending to
 * reduce a explicit constructor call containing the cursor.
 * e.g.
 *
 *	class X {
 *    X() {
 *      this(1, 2, [cursor]
 *    }
 *  }
 *
 *	---> class X {
 *         X() {
 *           <CompleteOnExplicitConstructorCall:this(1, 2)>
 *         }
 *       }
 *
 * The source range is always of length 0.
 * The arguments of the constructor call are all the arguments defined
 * before the cursor.
 */
	public CompletionOnExplicitConstructorCall(int accessMode) {
		super(accessMode);
	}
	public StringBuffer printStatement(int tabStringBuffer output) {
		printIndent(taboutput);
		output.append("<CompleteOnExplicitConstructorCall:"); //$NON-NLS-1$
		if (this. != nullthis..printExpression(0, output).append('.');
		if (this. == ) {
			output.append("this("); //$NON-NLS-1$
else {
			output.append("super("); //$NON-NLS-1$
		}
		if (this. != null) {
			for (int i = 0; i < this..lengthi++) {
				if (i > 0) output.append(", "); //$NON-NLS-1$
				this.[i].printExpression(0, output);
			}
		}
		return output.append(")>;"); //$NON-NLS-1$
	}
	public void resolve(BlockScope scope) {
		ReferenceBinding receiverType = scope.enclosingSourceType();
		if (this. != null) {
			int argsLength = this..length;
			for (int a = argsLength; --a >= 0;)
				this.[a].resolveType(scope);
		}
		if (this. !=  && receiverType != null) {
			if (receiverType.isHierarchyInconsistent())
				throw new CompletionNodeFound();
			receiverType = receiverType.superclass();
		}
		if (receiverType == null)
			throw new CompletionNodeFound();
		else
			throw new CompletionNodeFound(thisreceiverTypescope);
	}
New to GrepCode? Check out our FAQ X