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.select;
11:
12: /*
13: * Selection node build by the parser in any case it was intending to
14: * reduce an import reference containing the assist identifier.
15: * e.g.
16: *
17: * import java.[start]io[end].*;
18: * class X {
19: * void foo() {
20: * }
21: * }
22: *
23: * ---> <SelectOnImport:java.io>
24: * class X {
25: * void foo() {
26: * }
27: * }
28: *
29: */
30:
31: import org.eclipse.jdt.internal.compiler.ast.ImportReference;
32:
33: public class SelectionOnImportReference extends ImportReference {
34:
35: public SelectionOnImportReference(char[][] tokens,
36: long[] positions, int modifiers) {
37: super (tokens, positions, false, modifiers);
38: }
39:
40: public StringBuffer print(int indent, StringBuffer output,
41: boolean withOnDemand) {
42:
43: printIndent(indent, output).append("<SelectOnImport:"); //$NON-NLS-1$
44: for (int i = 0; i < tokens.length; i++) {
45: if (i > 0)
46: output.append('.');
47: output.append(tokens[i]);
48: }
49: return output.append('>');
50: }
51: }
|