1 /*******************************************************************************
2 * Copyright (c) 2000, 2001, 2002 International Business Machines Corp. and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v0.5
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v05.html
9 * IBM Corporation - initial API and implementation
10 ******************************************************************************/
11 package net.sourceforge.phpdt.internal.codeassist.complete;
14 * Completion node build by the parser in any case it was intending to
15 * reduce an type reference located as a potential return type for a class
16 * member, containing the cursor location.
17 * This node is only a fake-field wrapper of the actual completion node
18 * which is accessible as the fake-field type.
26 * <CompleteOnType:Obj>;
29 * The source range is always of length 0.
30 * The arguments of the allocation expression are all the arguments defined
34 import net.sourceforge.phpdt.internal.compiler.ast.FieldDeclaration;
35 import net.sourceforge.phpdt.internal.compiler.ast.TypeReference;
36 import net.sourceforge.phpdt.internal.compiler.lookup.Scope;
37 import net.sourceforge.phpdt.internal.compiler.lookup.TypeBinding;
39 public class CompletionOnFieldType extends FieldDeclaration {
40 public boolean isLocalVariable;
42 public CompletionOnFieldType(TypeReference type, boolean isLocalVariable){
44 this.sourceStart = type.sourceStart;
45 this.sourceEnd = type.sourceEnd;
48 this.isLocalVariable = isLocalVariable;
50 public TypeBinding getTypeBinding(Scope scope) {
51 if(type instanceof CompletionOnSingleTypeReference)
52 throw new CompletionNodeFound(this, scope);
53 else // handle the qualified type ref directly
54 return type.getTypeBinding(scope);
56 public String toString(int tab) {
58 return type.toString(tab);