- added include declarations to Outline view
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / internal / compiler / ast / ImportReference.java
index d4b0966..d0d13d3 100644 (file)
@@ -15,26 +15,32 @@ import net.sourceforge.phpdt.internal.compiler.lookup.CompilationUnitScope;
 
 public class ImportReference extends AstNode {
        
-       public char[][] tokens;
-       public long[] sourcePositions; //each entry is using the code : (start<<32) + end
+//     public char[][] tokens;
+//     public long[] sourcePositions; //each entry is using the code : (start<<32) + end
        public boolean onDemand = true; //most of the time
+       public final char[] includeSource;
        public int declarationEnd;// doesn't include an potential trailing comment
        public int declarationSourceStart;
        public int declarationSourceEnd;
        public boolean used;
 
-public ImportReference(char[][] sources , long[] poss , boolean d) {
-       tokens = sources ;
-       sourcePositions = poss ;
+public ImportReference(char[] sourceString, int start, int end, boolean d) { // char[][] sources , long[] poss , boolean d) {
+//     tokens = sources ;
+//     sourcePositions = poss ;
+    includeSource = sourceString;
        onDemand = d;
-       sourceEnd = (int)(sourcePositions[sourcePositions.length-1] & 0x00000000FFFFFFFF);
-       sourceStart = (int)(sourcePositions[0]>>>32) ;
+       sourceEnd = end;//(int)(sourcePositions[sourcePositions.length-1] & 0x00000000FFFFFFFF);
+       sourceStart = start;//(int)(sourcePositions[0]>>>32) ;
 }
 /**
  * @return char[][]
  */
-public char[][] getImportName() {
-       return tokens;
+//public char[][] getImportName() {
+//     return tokens;
+//}
+
+public char[] getIncludeName() {
+return includeSource;
 }
 public String toString(int tab ){
 
@@ -42,17 +48,18 @@ public String toString(int tab ){
 }
 public String toString(int tab, boolean withOnDemand) {
        /* when withOnDemand is false, only the name is printed */
-       StringBuffer buffer = new StringBuffer();
-       for (int i = 0; i < tokens.length; i++) {
-               buffer.append(tokens[i]);
-               if (i < (tokens.length - 1)) {
-                       buffer.append("."); //$NON-NLS-1$
-               }
-       }
-       if (withOnDemand && onDemand) {
-               buffer.append(".*"); //$NON-NLS-1$
-       }
-       return buffer.toString();
+//     StringBuffer buffer = new StringBuffer();
+//     for (int i = 0; i < tokens.length; i++) {
+//             buffer.append(tokens[i]);
+//             if (i < (tokens.length - 1)) {
+//                     buffer.append("."); //$NON-NLS-1$
+//             }
+//     }
+//     if (withOnDemand && onDemand) {
+//             buffer.append(".*"); //$NON-NLS-1$
+//     }
+//     return buffer.toString();
+    return new String(includeSource);
 }
 public void traverse(IAbstractSyntaxTreeVisitor visitor, CompilationUnitScope scope) {
        visitor.visit(this, scope);