87a344bba1aaec51dcbaf91221a8646ccaeefef4
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / codeassist / select / SelectionOnPackageReference.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2001, 2002 International Business Machines Corp. and others.
3  * All rights reserved. This program and the accompanying materials 
4  * are made available under the terms of the Common Public License v0.5 
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v05.html
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  ******************************************************************************/
11 package net.sourceforge.phpdt.internal.codeassist.select;
12
13 /*
14  * Selection node build by the parser in any case it was intending to
15  * reduce an package statement containing the assist identifier.
16  * e.g.
17  *
18  *  package java.[start]io[end];
19  *      class X {
20  *    void foo() {
21  *    }
22  *  }
23  *
24  *      ---> <SelectOnPackage:java.io>
25  *               class X {
26  *         void foo() {
27  *         }
28  *       }
29  *
30  */
31  
32 import net.sourceforge.phpdt.internal.compiler.ast.ImportReference;
33
34 public class SelectionOnPackageReference extends ImportReference {
35 public SelectionOnPackageReference(char[][] tokens , long[] positions) {
36         super(tokens, positions, true);
37 }
38 public String toString(int tab, boolean withOnDemand) {
39         StringBuffer buffer = new StringBuffer(tabString(tab));
40         buffer. append("<SelectOnPackage:"); //$NON-NLS-1$
41         for (int i = 0; i < tokens.length; i++) {
42                 buffer.append(tokens[i]);
43                 if (i < (tokens.length - 1)) {
44                         buffer.append("."); //$NON-NLS-1$
45                 }
46         }
47         buffer.append(">"); //$NON-NLS-1$
48         return buffer.toString();
49 }
50 }