1) Moved net.sourceforge.phpeclipse.ui\src\net\sourceforge\phpdt back to net.sourcefo...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / corext / template / php / CodeTemplateContextType.java
index 94dd363..9e0d590 100644 (file)
@@ -15,6 +15,7 @@ import java.util.ArrayList;
 import net.sourceforge.phpdt.core.ToolFactory;
 import net.sourceforge.phpdt.core.compiler.IScanner;
 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.corext.codemanipulation.StubUtility;
 
@@ -429,7 +430,7 @@ public class CodeTemplateContextType extends TemplateContextType {
        protected void validateVariables(TemplateVariable[] variables)
                        throws TemplateException {
                ArrayList required = new ArrayList(5);
-               String contextName = getId();
+               //String contextName = getId();
                // if (NEWTYPE_CONTEXTTYPE.equals(contextName)) {
                // required.add(PACKAGE_DECLARATION);
                // required.add(TYPE_DECLARATION);
@@ -459,9 +460,9 @@ public class CodeTemplateContextType extends TemplateContextType {
         * 
         * @see net.sourceforge.phpdt.internal.corext.template.ContextType#createContext()
         */
-       public TemplateContext createContext() {
-               return null;
-       }
+//     public TemplateContext createContext() {
+//             return null;
+//     }
 
        public static void registerContextTypes(ContextTypeRegistry registry) {
                registry.addContextType(new CodeTemplateContextType(
@@ -513,13 +514,13 @@ public class CodeTemplateContextType extends TemplateContextType {
                IScanner scanner = ToolFactory.createScanner(true, false, false, true);// false);
                scanner.setSource(template.toCharArray());
                try {
-                       int next = scanner.getNextToken();
-                       while (next == ITerminalSymbols.TokenNameCOMMENT_LINE
-                                       || next == ITerminalSymbols.TokenNameCOMMENT_PHPDOC
-                                       || next == ITerminalSymbols.TokenNameCOMMENT_BLOCK) {
+                       TokenName next = scanner.getNextToken();
+                       while (next == ITerminalSymbols.TokenName.COMMENT_LINE
+                                       || next == ITerminalSymbols.TokenName.COMMENT_PHPDOC
+                                       || next == ITerminalSymbols.TokenName.COMMENT_BLOCK) {
                                next = scanner.getNextToken();
                        }
-                       return next == ITerminalSymbols.TokenNameEOF;
+                       return next == ITerminalSymbols.TokenName.EOF;
                } catch (InvalidInputException e) {
                }
                return false;