KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > codeassist > select > SelectionOnImportReference


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.select;
12
13 /*
14  * Selection node build by the parser in any case it was intending to
15  * reduce an import reference containing the assist identifier.
16  * e.g.
17  *
18  * import java.[start]io[end].*;
19  * class X {
20  * void foo() {
21  * }
22  * }
23  *
24  * ---> <SelectOnImport:java.io>
25  * class X {
26  * void foo() {
27  * }
28  * }
29  *
30  */

31  
32 import org.eclipse.jdt.internal.compiler.ast.ImportReference;
33
34 public class SelectionOnImportReference extends ImportReference {
35
36 public SelectionOnImportReference(char[][] tokens , long[] positions, int modifiers) {
37     super(tokens, positions, false, modifiers);
38 }
39 public StringBuffer JavaDoc print(int indent, StringBuffer JavaDoc output, boolean withOnDemand) {
40
41     printIndent(indent, output).append("<SelectOnImport:"); //$NON-NLS-1$
42
for (int i = 0; i < tokens.length; i++) {
43         if (i > 0) output.append('.');
44         output.append(tokens[i]);
45     }
46     return output.append('>');
47 }
48 }
49
Popular Tags