KickJava   Java API By Example, From Geeks To Geeks.

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


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.core.compiler.CharOperation;
14 import org.eclipse.jdt.internal.compiler.CompilationResult;
15 import org.eclipse.jdt.internal.compiler.ast.MethodDeclaration;
16 import org.eclipse.jdt.internal.compiler.ast.TypeParameter;
17
18 public class CompletionOnMethodTypeParameter extends MethodDeclaration {
19     public CompletionOnMethodTypeParameter(TypeParameter[] typeParameters, CompilationResult compilationResult){
20         super(compilationResult);
21         this.selector = CharOperation.NO_CHAR;
22         this.typeParameters = typeParameters;
23         this.sourceStart = typeParameters[0].sourceStart;
24         this.sourceEnd = typeParameters[typeParameters.length - 1].sourceEnd;
25     }
26     
27     public void resolveStatements() {
28             throw new CompletionNodeFound(this, this.scope);
29     }
30     
31     public StringBuffer JavaDoc print(int tab, StringBuffer JavaDoc output) {
32         printIndent(tab, output);
33         output.append('<');
34         int max = typeParameters.length - 1;
35         for (int j = 0; j < max; j++) {
36             typeParameters[j].print(0, output);
37             output.append(", ");//$NON-NLS-1$
38
}
39         typeParameters[max].print(0, output);
40         output.append('>');
41         return output;
42     }
43
44 }
45
Popular Tags