KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > codeassist > complete > CompletionOnMethodName


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.codeassist.complete;
12
13 import org.eclipse.jdt.internal.compiler.CompilationResult;
14 import org.eclipse.jdt.internal.compiler.ast.MethodDeclaration;
15 import org.eclipse.jdt.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 StringBuffer JavaDoc print(int indent, StringBuffer JavaDoc output) {
25
26         printIndent(indent, output);
27         output.append("<CompletionOnMethodName:"); //$NON-NLS-1$
28
printModifiers(this.modifiers, output);
29         printReturnType(0, output);
30         output.append(selector).append('(');
31         if (arguments != null) {
32             for (int i = 0; i < arguments.length; i++) {
33                 if (i > 0) output.append(", "); //$NON-NLS-1$
34
arguments[i].print(0, output);
35             }
36         }
37         output.append(')');
38         if (thrownExceptions != null) {
39             output.append(" throws "); //$NON-NLS-1$
40
for (int i = 0; i < thrownExceptions.length; i++) {
41                 if (i > 0) output.append(", "); //$NON-NLS-1$
42
thrownExceptions[i].print(0, output);
43             }
44         }
45         return output.append('>');
46     }
47     
48     public void resolve(ClassScope upperScope) {
49         
50         super.resolve(upperScope);
51         throw new CompletionNodeFound(this, upperScope);
52     }
53 }
54
Popular Tags