01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jdt.internal.codeassist.complete;
11:
12: import org.eclipse.jdt.internal.compiler.ast.ImportReference;
13: import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
14:
15: public class CompletionOnKeyword2 extends ImportReference implements
16: CompletionOnKeyword {
17: private char[] token;
18: private char[][] possibleKeywords;
19:
20: public CompletionOnKeyword2(char[] token, long pos,
21: char[][] possibleKeywords) {
22: super (new char[][] { token }, new long[] { pos }, false,
23: ClassFileConstants.AccDefault);
24: this .token = token;
25: this .possibleKeywords = possibleKeywords;
26: }
27:
28: public boolean canCompleteEmptyToken() {
29: return false;
30: }
31:
32: public char[] getToken() {
33: return token;
34: }
35:
36: public char[][] getPossibleKeywords() {
37: return possibleKeywords;
38: }
39:
40: public StringBuffer print(int indent, StringBuffer output,
41: boolean withOnDemand) {
42:
43: return printIndent(indent, output)
44: .append("<CompleteOnKeyword:").append(token).append('>'); //$NON-NLS-1$
45: }
46: }
|