KickJava   Java API By Example, From Geeks To Geeks.

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


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.ImportReference;
14 import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
15
16 public class CompletionOnKeyword2 extends ImportReference implements CompletionOnKeyword {
17     private char[] token;
18     private char[][] possibleKeywords;
19     public CompletionOnKeyword2(char[] token, long pos, char[][] possibleKeywords) {
20         super(new char[][]{token}, new long[]{pos}, false, ClassFileConstants.AccDefault);
21         this.token = token;
22         this.possibleKeywords = possibleKeywords;
23     }
24     public boolean canCompleteEmptyToken() {
25         return false;
26     }
27     public char[] getToken() {
28         return token;
29     }
30     public char[][] getPossibleKeywords() {
31         return possibleKeywords;
32     }
33     public StringBuffer JavaDoc print(int indent, StringBuffer JavaDoc output, boolean withOnDemand) {
34         
35         return printIndent(indent, output).append("<CompleteOnKeyword:").append(token).append('>'); //$NON-NLS-1$
36
}
37 }
38
Popular Tags