1) Moved net.sourceforge.phpeclipse.ui\src\net\sourceforge\phpdt back to net.sourcefo...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / ltk / core / RenameLocalVariableDelegate.java
index b61f6a4..e9cde45 100644 (file)
@@ -9,6 +9,7 @@ import java.util.ArrayList;
 
 import net.sourceforge.phpdt.core.ISourceRange;
 import net.sourceforge.phpdt.core.compiler.ITerminalSymbols;
+import net.sourceforge.phpdt.core.compiler.ITerminalSymbols.TokenName;
 import net.sourceforge.phpdt.core.compiler.InvalidInputException;
 import net.sourceforge.phpdt.internal.compiler.parser.Scanner;
 import net.sourceforge.phpdt.internal.compiler.parser.SyntaxError;
@@ -70,11 +71,11 @@ public class RenameLocalVariableDelegate extends RenameIdentifierDelegate {
                                                .getLength(), result);
                        }
                } catch (CoreException e) {
-                       String msg = "Project: " + project.getLocation().toOSString()
+                       String msg = "Project: " + project.getFullPath().toOSString()
                                        + " CoreException " + e.getMessage();
                        result.addError(msg);
                } catch (Exception e) {
-                       String msg = "Project: " + project.getLocation().toOSString()
+                       String msg = "Project: " + project.getFullPath().toOSString()
                                        + " Exception " + e.getMessage();
                        result.addError(msg);
                }
@@ -116,14 +117,14 @@ public class RenameLocalVariableDelegate extends RenameIdentifierDelegate {
                        //
                        Scanner firstScanner = new Scanner(true, false);
                        firstScanner.setSource(content.toCharArray());
-                       int fToken = ITerminalSymbols.TokenNameEOF;
+                       TokenName fToken = ITerminalSymbols.TokenName.EOF;
                        int start = 0;
                        int phpdocStart = -1;
                        try {
                                fToken = firstScanner.getNextToken();
-                               while (fToken != ITerminalSymbols.TokenNameEOF
+                               while (fToken != ITerminalSymbols.TokenName.EOF
                                                && start < offset) {
-                                       if (fToken == ITerminalSymbols.TokenNameCOMMENT_PHPDOC) {
+                                       if (fToken == ITerminalSymbols.TokenName.COMMENT_PHPDOC) {
                                                phpdocStart = firstScanner
                                                                .getCurrentTokenStartPosition();
                                        } else {
@@ -134,11 +135,11 @@ public class RenameLocalVariableDelegate extends RenameIdentifierDelegate {
                                }
 
                        } catch (InvalidInputException e) {
-                               String msg = "File: " + file.getLocation().toOSString()
+                               String msg = "File: " + file.getFullPath().toOSString()
                                                + " InvalidInputException " + e.getMessage();
                                status.addError(msg);
                        } catch (SyntaxError e) {
-                               String msg = "File: " + file.getLocation().toOSString()
+                               String msg = "File: " + file.getFullPath().toOSString()
                                                + " SyntaxError " + e.getMessage();
                                status.addError(msg);
                        }
@@ -160,7 +161,7 @@ public class RenameLocalVariableDelegate extends RenameIdentifierDelegate {
                        boolean renameOtherComments = info.isRenameOtherComments();
                        char[] word = wordStr.toCharArray();
 
-                       fToken = ITerminalSymbols.TokenNameEOF;
+                       fToken = ITerminalSymbols.TokenName.EOF;
                        // double quoted string
                        String tokenString;
                        // double quoted string offset
@@ -168,8 +169,8 @@ public class RenameLocalVariableDelegate extends RenameIdentifierDelegate {
                        int index;
                        try {
                                fToken = secondScanner.getNextToken();
-                               while (fToken != ITerminalSymbols.TokenNameEOF) {
-                                       if (fToken == ITerminalSymbols.TokenNameVariable) {
+                               while (fToken != ITerminalSymbols.TokenName.EOF) {
+                                       if (fToken == ITerminalSymbols.TokenName.VARIABLE) {
                                                if (secondScanner.equalsCurrentTokenSource(word)) {
                                                        // the current variable token is equal to the given
                                                        // word
@@ -177,7 +178,7 @@ public class RenameLocalVariableDelegate extends RenameIdentifierDelegate {
                                                                        .getCurrentTokenStartPosition()
                                                                        + offset));
                                                }
-                                       } else if (fToken == ITerminalSymbols.TokenNameStringDoubleQuote
+                                       } else if (fToken == ITerminalSymbols.TokenName.STRINGDOUBLEQUOTE
                                                        && renameDQString) {
                                                // determine the word in double quoted strings:
                                                tokenString = new String(secondScanner
@@ -189,7 +190,7 @@ public class RenameLocalVariableDelegate extends RenameIdentifierDelegate {
                                                        matches.add(new Integer(offset + tokenOffset
                                                                        + index));
                                                }
-                                       } else if (fToken == ITerminalSymbols.TokenNameCOMMENT_PHPDOC
+                                       } else if (fToken == ITerminalSymbols.TokenName.COMMENT_PHPDOC
                                                        && renamePHPdoc) {
                                                tokenString = new String(secondScanner
                                                                .getCurrentTokenSource());
@@ -200,7 +201,7 @@ public class RenameLocalVariableDelegate extends RenameIdentifierDelegate {
                                                        matches.add(new Integer(offset + tokenOffset
                                                                        + index));
                                                }
-                                       } else if ((fToken == ITerminalSymbols.TokenNameCOMMENT_BLOCK || fToken == ITerminalSymbols.TokenNameCOMMENT_LINE)
+                                       } else if ((fToken == ITerminalSymbols.TokenName.COMMENT_BLOCK || fToken == ITerminalSymbols.TokenName.COMMENT_LINE)
                                                        && renameOtherComments) {
                                                tokenString = new String(secondScanner
                                                                .getCurrentTokenSource());
@@ -216,17 +217,17 @@ public class RenameLocalVariableDelegate extends RenameIdentifierDelegate {
                                }
 
                        } catch (InvalidInputException e) {
-                               String msg = "File: " + file.getLocation().toOSString()
+                               String msg = "File: " + file.getFullPath().toOSString()
                                                + " InvalidInputException " + e.getMessage();
                                status.addError(msg);
                        } catch (SyntaxError e) {
-                               String msg = "File: " + file.getLocation().toOSString()
+                               String msg = "File: " + file.getFullPath().toOSString()
                                                + " SyntaxError " + e.getMessage();
                                status.addError(msg);
                        }
 
                } catch (Exception e) {
-                       String msg = "File: " + file.getLocation().toOSString()
+                       String msg = "File: " + file.getFullPath().toOSString()
                                        + " Exception " + e.getMessage();
                        status.addError(msg);
                }