misc changes
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / codeassist / complete / CompletionOnMethodName.java
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.CompilationResult;
14 import net.sourceforge.phpdt.internal.compiler.ast.MethodDeclaration;
15 import net.sourceforge.phpdt.internal.compiler.lookup.ClassScope;
16
17 public class CompletionOnMethodName extends MethodDeclaration {
18         public int selectorEnd;
19
20         public CompletionOnMethodName(CompilationResult compilationResult){
21                 super(compilationResult);
22         }
23         
24         public void resolve(ClassScope upperScope) {
25                 
26                 super.resolve(upperScope);
27                 throw new CompletionNodeFound(this, upperScope);
28         }
29
30         public String toString(int tab) {
31
32                 String s = tabString(tab);
33                 s += "<CompletionOnMethodName:"; //$NON-NLS-1$
34
35                 if (modifiers != AccDefault) {
36                         s += modifiersString(modifiers);
37                 }
38
39                 s += returnTypeToString(0);
40                 s += new String(selector) + "("; //$NON-NLS-1$
41                 if (arguments != null) {
42                         for (int i = 0; i < arguments.length; i++) {
43                                 s += arguments[i].toString(0);
44                                 if (i != (arguments.length - 1))
45                                         s = s + ", "; //$NON-NLS-1$
46                         };
47                 };
48                 s += ")"; //$NON-NLS-1$
49                 if (thrownExceptions != null) {
50                         s += " throws "; //$NON-NLS-1$
51                         for (int i = 0; i < thrownExceptions.length; i++) {
52                                 s += thrownExceptions[i].toString(0);
53                                 if (i != (thrownExceptions.length - 1))
54                                         s = s + ", "; //$NON-NLS-1$
55                         };
56                 };
57
58                 s += ">"; //$NON-NLS-1$
59                 return s;
60         }
61 }