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