KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > codeassist > select > SelectionOnParameterizedSingleTypeReference


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.select;
12
13 import org.eclipse.jdt.internal.compiler.ast.ParameterizedSingleTypeReference;
14 import org.eclipse.jdt.internal.compiler.ast.TypeReference;
15 import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
16 import org.eclipse.jdt.internal.compiler.lookup.ClassScope;
17 import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
18
19 public class SelectionOnParameterizedSingleTypeReference extends ParameterizedSingleTypeReference {
20     public SelectionOnParameterizedSingleTypeReference(char[] name, TypeReference[] typeArguments, long pos){
21         super(name, typeArguments, 0, pos);
22     }
23     
24     public TypeBinding resolveType(BlockScope scope, boolean checkBounds) {
25         super.resolveType(scope, checkBounds);
26         throw new SelectionNodeFound(this.resolvedType);
27     }
28     
29     public TypeBinding resolveType(ClassScope scope) {
30         super.resolveType(scope);
31         throw new SelectionNodeFound(this.resolvedType);
32     }
33     
34     public StringBuffer JavaDoc printExpression(int indent, StringBuffer JavaDoc output){
35         output.append("<SelectOnType:");//$NON-NLS-1$
36
output.append(token);
37         output.append('<');
38         int max = typeArguments.length - 1;
39         for (int i= 0; i < max; i++) {
40             typeArguments[i].print(0, output);
41             output.append(", ");//$NON-NLS-1$
42
}
43         typeArguments[max].print(0, output);
44         output.append('>');
45         output.append('>');
46         return output;
47     }
48 }
49
Popular Tags