Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2000, 2008 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 type reference containing the completion identifier as a single
  * name reference.
  * e.g.
  *
  *	class X extends Obj[cursor]
  *
  *	---> class X extends <CompleteOnType:Obj>
  *
  * The source range of the completion node denotes the source range
  * which should be replaced by the completion.
  */
 
 
 public static final int K_TYPE = 0;
 public static final int K_CLASS = 1;
 public static final int K_INTERFACE = 2;
 public static final int K_EXCEPTION = 3;
 
 private int kind = ;
 public boolean isCompletionNode;
 public boolean isConstructorType;
 
 public CompletionOnSingleTypeReference(char[] sourcelong pos) {
 	this(sourcepos);
 }
 public CompletionOnSingleTypeReference(char[] sourcelong posint kind) {
 	super(sourcepos);
 	this. = true;
 	this. = kind;
 }
 public void aboutToResolve(Scope scope) {
 	getTypeBinding(scope);
 }
 /*
  * No expansion of the completion reference into an array one
  */
 public TypeReference copyDims(int dim){
 	return this;
 }
 protected TypeBinding getTypeBinding(Scope scope) {
     if (this. != null) {
 		throw new CompletionNodeFound(this.scope);
     }
 	if(this.) {
 		throw new CompletionNodeFound(thisscope);
 	} else {
 		return super.getTypeBinding(scope);
 	}
 }
 public boolean isClass(){
 	return this. == ;
 }
 public boolean isInterface(){
 	return this. == ;
 }
 public boolean isException(){
 	return this. == ;
 }
 public boolean isSuperType(){
 	return this. ==  || this. == ;
 }
 public StringBuffer printExpression(int indentStringBuffer output){
 	switch (this.) {
 		case  :
 			output.append("<CompleteOnClass:");//$NON-NLS-1$
 			break;
 		case  :
 			output.append("<CompleteOnInterface:");//$NON-NLS-1$
 			break;
 		case  :
 			output.append("<CompleteOnException:");//$NON-NLS-1$
 			break;
 		default :
 			output.append("<CompleteOnType:");//$NON-NLS-1$
 			break;
 	}
 	return output.append(this.).append('>');
 }
 public TypeBinding resolveTypeEnclosing(BlockScope scopeReferenceBinding enclosingType) {
     if (this. != null) {
 		throw new CompletionNodeFound(this.scope);
    }
	if(this.) {
		throw new CompletionNodeFound(thisenclosingTypescope);
else {
		return super.resolveTypeEnclosing(scopeenclosingType);
	}
public void setKind(int kind) {
	this. = kind;
New to GrepCode? Check out our FAQ X