50bb8594aa466c6e32de4ecf621616905680ac71
[phpeclipse.git] /
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
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  ******************************************************************************/
11 package net.sourceforge.phpdt.internal.codeassist.complete;
12
13 import net.sourceforge.phpdt.internal.compiler.ast.Argument;
14 import net.sourceforge.phpdt.internal.compiler.ast.TypeReference;
15 import net.sourceforge.phpdt.internal.compiler.lookup.BlockScope;
16 import net.sourceforge.phpdt.internal.compiler.lookup.MethodScope;
17 import net.sourceforge.phpdt.internal.compiler.lookup.TypeBinding;
18 import net.sourceforge.phpdt.internal.compiler.util.CharOperation;
19
20
21 public class CompletionOnArgumentName extends Argument {
22         private static final char[] FAKENAMESUFFIX = " ".toCharArray(); //$NON-NLS-1$
23         public char[] realName;
24         public CompletionOnArgumentName(char[] name , long posNom , TypeReference tr , int modifiers){
25                 super(CharOperation.concat(name, FAKENAMESUFFIX), posNom, tr, modifiers);
26                 this.realName = name;
27         }
28         
29         public void resolve(BlockScope scope) {
30                 super.resolve(scope);
31                 throw new CompletionNodeFound(this, scope);
32         }
33         
34         public void bind(MethodScope scope, TypeBinding typeBinding, boolean used) {
35                 super.bind(scope, typeBinding, used);
36                 
37                 throw new CompletionNodeFound(this, scope);
38         }
39         
40         public String toString(int tab) {
41                 String s = tabString(tab);
42                 s += "<CompleteOnArgumentName:"; //$NON-NLS-1$
43                 if (type != null) s += type.toString() + " "; //$NON-NLS-1$
44                 s += new String(realName);
45                 if (initialization != null) s += " = " + initialization.toStringExpression(); //$NON-NLS-1$
46                 s += ">"; //$NON-NLS-1$
47                 return s;
48         }       
49 }
50