KickJava   Java API By Example, From Geeks To Geeks.

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


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.ast.SingleNameReference;
14 import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
15 import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
16
17 public class CompletionOnKeyword3 extends SingleNameReference implements CompletionOnKeyword{
18     private char[][] possibleKeywords;
19     public CompletionOnKeyword3(char[] token, long pos, char[] possibleKeyword) {
20         this(token, pos, new char[][]{possibleKeyword});
21     }
22     public CompletionOnKeyword3(char[] token, long pos, char[][] possibleKeywords) {
23         super(token, pos);
24         this.token = token;
25         this.possibleKeywords = possibleKeywords;
26     }
27     public boolean canCompleteEmptyToken() {
28         return false;
29     }
30     public char[] getToken() {
31         return token;
32     }
33     public char[][] getPossibleKeywords() {
34         return possibleKeywords;
35     }
36     public StringBuffer JavaDoc printExpression(int indent, StringBuffer JavaDoc output) {
37         
38         return output.append("<CompleteOnKeyword:").append(token).append('>'); //$NON-NLS-1$
39
}
40     public TypeBinding resolveType(BlockScope scope) {
41         throw new CompletionNodeFound(this, scope);
42     }
43 }
44
Popular Tags