added class fields to outline
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / core / ToolFactory.java
index fa0abb3..aea8d2e 100644 (file)
  *     IBM Corporation - added #createScanner allowing to make comment check stricter
  ******************************************************************************/
 package net.sourceforge.phpdt.core;
-
 import java.util.Map;
 
-import net.sourceforge.phpdt.core.compiler.IScanner;
 import net.sourceforge.phpdt.internal.compiler.parser.Scanner;
 import net.sourceforge.phpdt.internal.formatter.CodeFormatter;
-import net.sourceforge.phpeclipse.PHPCore;
 
 import org.eclipse.core.runtime.Plugin;
 
@@ -41,7 +39,7 @@ public class ToolFactory {
         */
        public static ICodeFormatter createCodeFormatter(){
                
-                       Plugin jdtCorePlugin = PHPCore.getPlugin();
+                       Plugin jdtCorePlugin = JavaCore.getPlugin();
                        if (jdtCorePlugin == null) return null;
                
 //                     IExtensionPoint extension = jdtCorePlugin.getDescriptor().getExtensionPoint(JavaModelManager.FORMATTER_EXTPOINT_ID);
@@ -80,7 +78,7 @@ public class ToolFactory {
         */
        public static ICodeFormatter createDefaultCodeFormatter(Map options){
 
-               if (options == null) options = PHPCore.getOptions();
+               if (options == null) options = JavaCore.getOptions();
                return new CodeFormatter(options);
        }
        
@@ -157,10 +155,18 @@ public class ToolFactory {
         * @see org.phpeclipse.phpdt.core.compiler.IScanner
         * @since 2.1
         */
-       public static IScanner createScanner(boolean tokenizeComments, boolean tokenizeWhiteSpace, boolean recordLineSeparator){
+       public static Scanner createScanner(boolean tokenizeComments, boolean tokenizeWhiteSpace, boolean recordLineSeparator){
+
+               Scanner scanner = new Scanner(tokenizeComments, tokenizeWhiteSpace, false/*nls*/);
+               scanner.recordLineSeparator = recordLineSeparator;
+               return scanner;
+       }
+       
+       public static Scanner createScanner(boolean tokenizeComments, boolean tokenizeWhiteSpace, boolean recordLineSeparator, boolean phpMode){
 
                Scanner scanner = new Scanner(tokenizeComments, tokenizeWhiteSpace, false/*nls*/);
                scanner.recordLineSeparator = recordLineSeparator;
+               scanner.setPHPMode(phpMode);
                return scanner;
        }
 }