Register new file extensions for the php-editor:
authoraxelcl <axelcl>
Fri, 30 Sep 2005 18:10:37 +0000 (18:10 +0000)
committeraxelcl <axelcl>
Fri, 30 Sep 2005 18:10:37 +0000 (18:10 +0000)
* associate the extension with the PHP editor in Window->Preferences
* add extension to net.sourceforge.phpeclipse.phpSource in plugin.xml

12 files changed:
net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/JavaModelManager.java
net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/util/PHPFileUtil.java
net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/ui/text/PHPSourceViewerConfiguration.java
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/IPreferenceConstants.java
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPPerspectiveFactory.java
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/html/HTMLFormatter.java [deleted file]
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/html/HTMLFormattingStrategy.java [deleted file]
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/html/IHTMLConstants.java [deleted file]
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPPartitionScanner.java
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/Partition.java [deleted file]
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PartitionStack.java [deleted file]

index f860394..39978d1 100644 (file)
@@ -1,10 +1,10 @@
 /*******************************************************************************
  * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials 
+ * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Common Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/cpl-v10.html
- * 
+ *
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
@@ -82,7 +82,7 @@ import org.eclipse.core.runtime.Preferences.PropertyChangeEvent;
  * The single instance of <code>JavaModelManager</code> is available from
  * the static method <code>JavaModelManager.getJavaModelManager()</code>.
  */
-public class JavaModelManager implements ISaveParticipant {    
+public class JavaModelManager implements ISaveParticipant {
        /**
         * Unique handle onto the JavaModel
         */
@@ -97,7 +97,7 @@ public class JavaModelManager implements ISaveParticipant {
        public final static String CP_VARIABLE_PREFERENCES_PREFIX = PHPeclipsePlugin.PLUGIN_ID+".classpathVariable."; //$NON-NLS-1$
        public final static String CP_CONTAINER_PREFERENCES_PREFIX = PHPeclipsePlugin.PLUGIN_ID+".classpathContainer."; //$NON-NLS-1$
        public final static String CP_ENTRY_IGNORE = "##<cp entry ignore>##"; //$NON-NLS-1$
-               
+
        /**
         * Classpath containers pool
         */
@@ -117,8 +117,13 @@ public class JavaModelManager implements ISaveParticipant {
        /**
         * Name of the extension point for contributing a source code formatter
         */
-       public static final String FORMATTER_EXTPOINT_ID = "codeFormatter" ; //$NON-NLS-1$
-       
+       public static final String FORMATTER_EXTPOINT_ID = "codeFormatter" ; //$/**
+
+       /**
+        * Value of the content-type for Java source files
+        */
+       public static final String JAVA_SOURCE_CONTENT_TYPE = PHPeclipsePlugin.PLUGIN_ID+".phpSource" ; //$NON-NLS-1$NON-NLS-1$
+
        /**
         * Special value used for recognizing ongoing initialization and breaking initialization cycles
         */
@@ -130,7 +135,7 @@ public class JavaModelManager implements ISaveParticipant {
 //             public IPath getPath() { return null; }
 //             public String toString() { return getDescription(); }
 //     };
-       
+
        private static final String INDEX_MANAGER_DEBUG = PHPeclipsePlugin.PLUGIN_ID + "/debug/indexmanager" ; //$NON-NLS-1$
        private static final String COMPILER_DEBUG = PHPeclipsePlugin.PLUGIN_ID + "/debug/compiler" ; //$NON-NLS-1$
        private static final String JAVAMODEL_DEBUG = PHPeclipsePlugin.PLUGIN_ID + "/debug/javamodel" ; //$NON-NLS-1$
@@ -146,7 +151,7 @@ public class JavaModelManager implements ISaveParticipant {
        private static final String SEARCH_DEBUG = PHPeclipsePlugin.PLUGIN_ID + "/debug/search" ; //$NON-NLS-1$
 
        public final static IWorkingCopy[] NoWorkingCopy = new IWorkingCopy[0];
-       
+
        /**
         * Table from WorkingCopyOwner to a table of ICompilationUnit (working copy handle) to PerWorkingCopyInfo.
         * NOTE: this object itself is used as a lock to synchronize creation/removal of per working copy infos
@@ -188,7 +193,7 @@ public class JavaModelManager implements ISaveParticipant {
                }
        }
 
-//     public static IClasspathContainer containerGet(IJavaProject project, IPath containerPath) {     
+//     public static IClasspathContainer containerGet(IJavaProject project, IPath containerPath) {
 //             Map projectContainers = (Map)Containers.get(project);
 //             if (projectContainers == null){
 //                     return null;
@@ -292,7 +297,7 @@ public class JavaModelManager implements ISaveParticipant {
                if (project == null) {
                        project = JavaCore.create(file.getProject());
                }
-       
+
                if (file.getFileExtension() != null) {
                        String name = file.getName();
                        if (PHPFileUtil.isValidPHPUnitName(name))
@@ -308,7 +313,7 @@ public class JavaModelManager implements ISaveParticipant {
 
        /**
         * Returns the package fragment or package fragment root corresponding to the given folder,
-        * its parent or great parent being the given project. 
+        * its parent or great parent being the given project.
         * or <code>null</code> if unable to associate the given folder with a Java element.
         * <p>
         * Note that a package fragment root is returned rather than a default package.
@@ -325,7 +330,7 @@ public class JavaModelManager implements ISaveParticipant {
                }
                IJavaElement element = determineIfOnClasspath(folder, project);
                if (conflictsWithOutputLocation(folder.getFullPath(), (JavaProject)project)
-                       || (folder.getName().indexOf('.') >= 0 
+                       || (folder.getName().indexOf('.') >= 0
                                && !(element instanceof IPackageFragmentRoot))) {
                        return null; // only package fragment roots are allowed with dot names
                } else {
@@ -354,9 +359,9 @@ public class JavaModelManager implements ISaveParticipant {
 //             }
 //             return pkg.getClassFile(file.getName());
 //     }
-       
+
        /**
-        * Creates and returns a compilation unit element for the given <code>.java</code> 
+        * Creates and returns a compilation unit element for the given <code>.java</code>
         * file, its project being the given project. Returns <code>null</code> if unable
         * to recognize the compilation unit.
         */
@@ -372,7 +377,7 @@ public class JavaModelManager implements ISaveParticipant {
                        // not on classpath - make the root its folder, and a default package
                        IPackageFragmentRoot root = project.getPackageFragmentRoot(file.getParent());
                        pkg = root.getPackageFragment(IPackageFragment.DEFAULT_PACKAGE_NAME);
-                       
+
                        if (VERBOSE){
                                System.out.println("WARNING : creating unit element outside classpath ("+ Thread.currentThread()+"): " + file.getFullPath()); //$NON-NLS-1$//$NON-NLS-2$
                        }
@@ -382,7 +387,7 @@ public class JavaModelManager implements ISaveParticipant {
        /**
         * Creates and returns a handle for the given JAR file, its project being the given project.
         * The Java model associated with the JAR's project may be
-        * created as a side effect. 
+        * created as a side effect.
         * Returns <code>null</code> if unable to create a JAR package fragment root.
         * (for example, if the JAR file represents a non-Java resource)
         */
@@ -393,7 +398,7 @@ public class JavaModelManager implements ISaveParticipant {
 //             if (project == null) {
 //                     project = PHPCore.create(file.getProject());
 //             }
-//     
+//
 //             // Create a jar package fragment root only if on the classpath
 //             IPath resourcePath = file.getFullPath();
 //             try {
@@ -409,7 +414,7 @@ public class JavaModelManager implements ISaveParticipant {
 //             }
 //             return null;
 //     }
-       
+
        /**
         * Returns the package fragment root represented by the resource, or
         * the package fragment the given resource is located in, or <code>null</code>
@@ -418,20 +423,20 @@ public class JavaModelManager implements ISaveParticipant {
        public static IJavaElement determineIfOnClasspath(
                IResource resource,
                IJavaProject project) {
-                       
+
                IPath resourcePath = resource.getFullPath();
                try {
-                       IClasspathEntry[] entries = 
+                       IClasspathEntry[] entries =
                                net.sourceforge.phpdt.internal.compiler.util.Util.isJavaFileName(resourcePath.lastSegment())
                                        ? project.getRawClasspath() // JAVA file can only live inside SRC folder (on the raw path)
                                        : ((JavaProject)project).getResolvedClasspath(true);
-                               
+
                        for (int i = 0; i < entries.length; i++) {
                                IClasspathEntry entry = entries[i];
                                if (entry.getEntryKind() == IClasspathEntry.CPE_PROJECT) continue;
                                IPath rootPath = entry.getPath();
                                if (rootPath.equals(resourcePath)) {
-                                       return project.getPackageFragmentRoot(resource);  
+                                       return project.getPackageFragmentRoot(resource);
                                } else if (rootPath.isPrefixOf(resourcePath) && !Util.isExcluded(resource, null, ((ClasspathEntry)entry).fullExclusionPatternChars())) {
                                        // given we have a resource child of the root, it cannot be a JAR pkg root
                                        IPackageFragmentRoot root = ((JavaProject) project).getFolderPackageFragmentRoot(rootPath);
@@ -441,7 +446,7 @@ public class JavaModelManager implements ISaveParticipant {
                                                // if the resource is a file, then remove the last segment which
                                                // is the file name in the package
                                                pkgPath = pkgPath.removeLastSegments(1);
-                                               
+
                                                // don't check validity of package name (see http://bugs.eclipse.org/bugs/show_bug.cgi?id=26706)
 //                                             String pkgName = pkgPath.toString().replace('/', '.');
                                                String pkgName = pkgPath.toString();
@@ -460,7 +465,7 @@ public class JavaModelManager implements ISaveParticipant {
                }
                return null;
        }
-       
+
        /**
         * The singleton manager
         */
@@ -520,7 +525,7 @@ public class JavaModelManager implements ISaveParticipant {
         */
        private final ModelUpdater modelUpdater =new ModelUpdater();
        /**
-        * Workaround for bug 15168 circular errors not reported  
+        * Workaround for bug 15168 circular errors not reported
         * This is a cache of the projects before any project addition/deletion has started.
         */
        public IJavaProject[] javaProjectsCache;
@@ -530,13 +535,13 @@ public class JavaModelManager implements ISaveParticipant {
         * NOTE: this object itself is used as a lock to synchronize creation/removal of per project infos
         */
        protected Map perProjectInfo = new HashMap(5);
-       
+
        /**
         * A map from ICompilationUnit to IWorkingCopy
         * of the shared working copies.
         */
        public Map sharedWorkingCopies = new HashMap();
-       
+
        /**
         * A weak set of the known scopes.
         */
@@ -558,9 +563,9 @@ public class JavaModelManager implements ISaveParticipant {
 //                     this.project = project;
 //             }
 //     }
-       
+
        public static class PerProjectInfo {
-               
+
                public IProject project;
                public Object savedState;
                public boolean triedRead;
@@ -569,14 +574,14 @@ public class JavaModelManager implements ISaveParticipant {
                public Map resolvedPathToRawEntries; // reverse map from resolved path to raw entries
                public IPath outputLocation;
                public Preferences preferences;
-               
+
                public PerProjectInfo(IProject project) {
 
                        this.triedRead = false;
                        this.savedState = null;
                        this.project = project;
                }
-               
+
                // updating raw classpath need to flush obsoleted cached information about resolved entries
                public synchronized void updateClasspathInformation(IClasspathEntry[] newRawClasspath) {
 
@@ -618,7 +623,7 @@ public class JavaModelManager implements ISaveParticipant {
                        return buffer.toString();
                }
        }
-       
+
        public static class PerWorkingCopyInfo implements IProblemRequestor {
                int useCount = 0;
                IProblemRequestor problemRequestor;
@@ -659,15 +664,15 @@ public class JavaModelManager implements ISaveParticipant {
        public static boolean VERBOSE = false;
        public static boolean CP_RESOLVE_VERBOSE = false;
        public static boolean ZIP_ACCESS_VERBOSE = false;
-       
+
        /**
         * A cache of opened zip files per thread.
         * (map from Thread to map of IPath to java.io.ZipFile)
         * NOTE: this object itself is used as a lock to synchronize creation/removal of entries
         */
        private HashMap zipFiles = new HashMap();
-       
-       
+
+
        /**
         * Update the classpath variable cache
         */
@@ -717,7 +722,7 @@ public class JavaModelManager implements ISaveParticipant {
        public void addElementChangedListener(IElementChangedListener listener, int eventMask) {
                for (int i = 0; i < this.elementChangedListenerCount; i++){
                        if (this.elementChangedListeners[i].equals(listener)){
-                               
+
                                // only clone the masks, since we could be in the middle of notifications and one listener decide to change
                                // any event mask of another listeners (yet not notified).
                                int cloneLength = this.elementChangedListenerMasks.length;
@@ -763,7 +768,7 @@ public class JavaModelManager implements ISaveParticipant {
                        }
                }
        }
-       
+
 
 
        /**
@@ -772,16 +777,16 @@ public class JavaModelManager implements ISaveParticipant {
        public void configurePluginDebugOptions(){
                if(JavaCore.getPlugin().isDebugging()){
 //             TODO jsurfer temp-del
-                       
+
                        String option = Platform.getDebugOption(BUILDER_DEBUG);
 //                     if(option != null) JavaBuilder.DEBUG = option.equalsIgnoreCase("true") ; //$NON-NLS-1$
-//                     
+//
 //                     option = Platform.getDebugOption(COMPILER_DEBUG);
 //                     if(option != null) Compiler.DEBUG = option.equalsIgnoreCase("true") ; //$NON-NLS-1$
 //
 //                     option = Platform.getDebugOption(COMPLETION_DEBUG);
 //                     if(option != null) CompletionEngine.DEBUG = option.equalsIgnoreCase("true") ; //$NON-NLS-1$
-//                     
+//
                        option = Platform.getDebugOption(CP_RESOLVE_DEBUG);
                        if(option != null) JavaModelManager.CP_RESOLVE_VERBOSE = option.equalsIgnoreCase("true") ; //$NON-NLS-1$
 
@@ -793,7 +798,7 @@ public class JavaModelManager implements ISaveParticipant {
 //
 //                     option = Platform.getDebugOption(INDEX_MANAGER_DEBUG);
 //                     if(option != null) IndexManager.VERBOSE = option.equalsIgnoreCase("true") ; //$NON-NLS-1$
-                       
+
                        option = Platform.getDebugOption(JAVAMODEL_DEBUG);
                        if(option != null) JavaModelManager.VERBOSE = option.equalsIgnoreCase("true") ; //$NON-NLS-1$
 
@@ -810,7 +815,7 @@ public class JavaModelManager implements ISaveParticipant {
                        if(option != null) JavaModelManager.ZIP_ACCESS_VERBOSE = option.equalsIgnoreCase("true") ; //$NON-NLS-1$
                }
        }
-       
+
 
        /*
         * Discards the per working copy info for the given working copy (making it a compilation unit)
@@ -827,10 +832,10 @@ public class JavaModelManager implements ISaveParticipant {
                        WorkingCopyOwner owner = workingCopy.owner;
                        Map workingCopyToInfos = (Map)this.perWorkingCopyInfos.get(owner);
                        if (workingCopyToInfos == null) return -1;
-                       
+
                        PerWorkingCopyInfo info = (PerWorkingCopyInfo)workingCopyToInfos.get(workingCopy);
                        if (info == null) return -1;
-                       
+
                        if (--info.useCount == 0) {
                                // create the delta builder (this remembers the current content of the working copy)
                                JavaElementDeltaBuilder deltaBuilder = null;
@@ -855,26 +860,26 @@ public class JavaModelManager implements ISaveParticipant {
                                                getDeltaProcessor().registerJavaModelDelta(deltaBuilder.delta);
                                        }
                                }
-                               
+
                        }
                        return info.useCount;
                }
        }
-       
+
        /**
         * @see ISaveParticipant
         */
        public void doneSaving(ISaveContext context){
        }
-       
+
        /**
         * Fire Java Model delta, flushing them after the fact after post_change notification.
-        * If the firing mode has been turned off, this has no effect. 
+        * If the firing mode has been turned off, this has no effect.
         */
        public void fire(IJavaElementDelta customDelta, int eventType) {
 
                if (!this.isFiring) return;
-               
+
                if (DeltaProcessor.VERBOSE && (eventType == DEFAULT_CHANGE_EVENT || eventType == ElementChangedEvent.PRE_AUTO_BUILD)) {
                        System.out.println("-----------------------------------------------------------------------------------------------------------------------");//$NON-NLS-1$
                }
@@ -885,7 +890,7 @@ public class JavaModelManager implements ISaveParticipant {
                } else {
                        deltaToNotify = customDelta;
                }
-                       
+
                // Refresh internal scopes
                if (deltaToNotify != null) {
 //             TODO  temp-del
@@ -895,9 +900,9 @@ public class JavaModelManager implements ISaveParticipant {
 //                             scope.processDelta(deltaToNotify);
 //                     }
                }
-                       
+
                // Notification
-       
+
                // Important: if any listener reacts to notification by updating the listeners list or mask, these lists will
                // be duplicated, so it is necessary to remember original lists in a variable (since field values may change under us)
                IElementChangedListener[] listeners = this.elementChangedListeners;
@@ -926,7 +931,7 @@ public class JavaModelManager implements ISaveParticipant {
                IElementChangedListener[] listeners,
                int[] listenerMask,
                int listenerCount) {
-                       
+
                if (DeltaProcessor.VERBOSE){
                        System.out.println("FIRING PRE_AUTO_BUILD Delta ["+Thread.currentThread()+"]:"); //$NON-NLS-1$//$NON-NLS-2$
                        System.out.println(deltaToNotify == null ? "<NONE>" : deltaToNotify.toString()); //$NON-NLS-1$
@@ -941,7 +946,7 @@ public class JavaModelManager implements ISaveParticipant {
                IElementChangedListener[] listeners,
                int[] listenerMask,
                int listenerCount) {
-                       
+
                // post change deltas
                if (DeltaProcessor.VERBOSE){
                        System.out.println("FIRING POST_CHANGE Delta ["+Thread.currentThread()+"]:"); //$NON-NLS-1$//$NON-NLS-2$
@@ -950,10 +955,10 @@ public class JavaModelManager implements ISaveParticipant {
                if (deltaToNotify != null) {
                        // flush now so as to keep listener reactions to post their own deltas for subsequent iteration
                        this.flush();
-                       
+
                        notifyListeners(deltaToNotify, ElementChangedEvent.POST_CHANGE, listeners, listenerMask, listenerCount);
-               } 
-       }               
+               }
+       }
        private void fireReconcileDelta(
                IElementChangedListener[] listeners,
                int[] listenerMask,
@@ -968,9 +973,9 @@ public class JavaModelManager implements ISaveParticipant {
                if (deltaToNotify != null) {
                        // flush now so as to keep listener reactions to post their own deltas for subsequent iteration
                        this.reconcileDeltas = new HashMap();
-               
+
                        notifyListeners(deltaToNotify, ElementChangedEvent.POST_RECONCILE, listeners, listenerMask, listenerCount);
-               } 
+               }
        }
 
        public void notifyListeners(IJavaElementDelta deltaToNotify, int eventType, IElementChangedListener[] listeners, int[] listenerMask, int listenerCount) {
@@ -998,7 +1003,7 @@ public class JavaModelManager implements ISaveParticipant {
                        }
                }
        }
-       
+
        /**
         * Flushes all deltas without firing them.
         */
@@ -1025,14 +1030,14 @@ public class JavaModelManager implements ISaveParticipant {
                                } catch (IOException e) {
                                }
                        }
-               }       
+               }
        }
-       
+
 
        public DeltaProcessor getDeltaProcessor() {
                return this.deltaState.getDeltaProcessor();
        }
-       /** 
+       /**
         * Returns the set of elements which are out of synch with their buffers.
         */
        protected Map getElementsOutOfSynchWithBuffers() {
@@ -1043,7 +1048,7 @@ public class JavaModelManager implements ISaveParticipant {
 //             return this.indexManager;
 //     }
        /**
-        * Returns the <code>IJavaElement</code> represented by the 
+        * Returns the <code>IJavaElement</code> represented by the
         * <code>String</code> memento.
         */
        public IJavaElement getHandleFromMemento(String memento) throws JavaModelException {
@@ -1155,8 +1160,8 @@ public class JavaModelManager implements ISaveParticipant {
                        }
                        return info;
                }
-       }       
-       
+       }
+
        /*
         * Returns  the per-project info for the given project.
         * If the info doesn't exist, check for the project existence and create the info.
@@ -1195,12 +1200,12 @@ public class JavaModelManager implements ISaveParticipant {
                        if (info != null && recordUsage) info.useCount++;
                        return info;
                }
-       }       
+       }
        /**
         * Returns the name of the variables for which an CP variable initializer is registered through an extension point
         */
        public static String[] getRegisteredVariableNames(){
-               
+
                Plugin jdtCorePlugin = JavaCore.getPlugin();
                if (jdtCorePlugin == null) return null;
 
@@ -1214,18 +1219,18 @@ public class JavaModelManager implements ISaveParticipant {
 //                                     String varAttribute = configElements[j].getAttribute("variable"); //$NON-NLS-1$
 //                                     if (varAttribute != null) variableList.add(varAttribute);
 //                             }
-//                     }       
+//                     }
 //             }
                String[] variableNames = new String[variableList.size()];
                variableList.toArray(variableNames);
                return variableNames;
-       }       
+       }
 
        /**
         * Returns the name of the container IDs for which an CP container initializer is registered through an extension point
         */
 //     public static String[] getRegisteredContainerIDs(){
-//             
+//
 //             Plugin jdtCorePlugin = PHPCore.getPlugin();
 //             if (jdtCorePlugin == null) return null;
 //
@@ -1239,12 +1244,12 @@ public class JavaModelManager implements ISaveParticipant {
 //                                     String idAttribute = configElements[j].getAttribute("id"); //$NON-NLS-1$
 //                                     if (idAttribute != null) containerIDList.add(idAttribute);
 //                             }
-//                     }       
+//                     }
 //             }
 //             String[] containerIDs = new String[containerIDList.size()];
 //             containerIDList.toArray(containerIDs);
 //             return containerIDs;
-//     }       
+//     }
 
        /**
         * Returns the File to use for saving and restoring the last built state for the given project.
@@ -1254,7 +1259,7 @@ public class JavaModelManager implements ISaveParticipant {
                IPath workingLocation = project.getWorkingLocation(JavaCore.PLUGIN_ID);
                return workingLocation.append("state.dat").toFile(); //$NON-NLS-1$
        }
-       
+
        /*
         * Returns the temporary cache for newly opened elements for the current thread.
         * Creates it if not already created.
@@ -1275,14 +1280,14 @@ public class JavaModelManager implements ISaveParticipant {
         * @exception CoreException If unable to create/open the ZipFile
         */
        public ZipFile getZipFile(IPath path) throws CoreException {
-                       
+
                synchronized(this.zipFiles) { // TODO:  use PeThreadObject which does synchronization
                        Thread currentThread = Thread.currentThread();
                        HashMap map = null;
                        ZipFile zipFile;
-                       if ((map = (HashMap)this.zipFiles.get(currentThread)) != null 
+                       if ((map = (HashMap)this.zipFiles.get(currentThread)) != null
                                        && (zipFile = (ZipFile)map.get(path)) != null) {
-                                       
+
                                return zipFile;
                        }
                        String fileSystemPath= null;
@@ -1311,7 +1316,7 @@ public class JavaModelManager implements ISaveParticipant {
                        } else {
                                fileSystemPath= path.toOSString();
                        }
-       
+
                        try {
                                if (ZIP_ACCESS_VERBOSE) {
                                        System.out.println("(" + currentThread + ") [JavaModelManager.getZipFile(IPath)] Creating ZipFile on " + fileSystemPath ); //$NON-NLS-1$ //$NON-NLS-2$
@@ -1334,10 +1339,10 @@ public class JavaModelManager implements ISaveParticipant {
        }
 //     public void loadVariablesAndContainers() throws CoreException {
 //
-//             // backward compatibility, consider persistent property 
+//             // backward compatibility, consider persistent property
 //             QualifiedName qName = new QualifiedName(PHPCore.PLUGIN_ID, "variables"); //$NON-NLS-1$
 //             String xmlString = ResourcesPlugin.getWorkspace().getRoot().getPersistentProperty(qName);
-//             
+//
 //             try {
 //                     if (xmlString != null){
 //                             StringReader reader = new StringReader(xmlString);
@@ -1356,7 +1361,7 @@ public class JavaModelManager implements ISaveParticipant {
 //                             if (!cpElement.getNodeName().equalsIgnoreCase("variables")) { //$NON-NLS-1$
 //                                     return;
 //                             }
-//                             
+//
 //                             NodeList list= cpElement.getChildNodes();
 //                             int length= list.getLength();
 //                             for (int i= 0; i < length; ++i) {
@@ -1365,7 +1370,7 @@ public class JavaModelManager implements ISaveParticipant {
 //                                     if (type == Node.ELEMENT_NODE) {
 //                                             Element element= (Element) node;
 //                                             if (element.getNodeName().equalsIgnoreCase("variable")) { //$NON-NLS-1$
-//                                                     variablePut( 
+//                                                     variablePut(
 //                                                             element.getAttribute("name"), //$NON-NLS-1$
 //                                                             new Path(element.getAttribute("path"))); //$NON-NLS-1$
 //                                             }
@@ -1377,9 +1382,9 @@ public class JavaModelManager implements ISaveParticipant {
 //                     if (xmlString != null){
 //                             ResourcesPlugin.getWorkspace().getRoot().setPersistentProperty(qName, null); // flush old one
 //                     }
-//                     
+//
 //             }
-//             
+//
 //             // load variables and containers from preferences into cache
 //             Preferences preferences = PHPeclipsePlugin.getDefault().getPluginPreferences();
 
@@ -1391,8 +1396,8 @@ public class JavaModelManager implements ISaveParticipant {
 //                     if (propertyName.startsWith(CP_VARIABLE_PREFERENCES_PREFIX)){
 //                             String varName = propertyName.substring(variablePrefixLength);
 //                             IPath varPath = new Path(preferences.getString(propertyName).trim());
-//                             
-//                             Variables.put(varName, varPath); 
+//
+//                             Variables.put(varName, varPath);
 //                             PreviousSessionVariables.put(varName, varPath);
 //                     }
 //                     if (propertyName.startsWith(CP_CONTAINER_PREFERENCES_PREFIX)){
@@ -1432,11 +1437,11 @@ public class JavaModelManager implements ISaveParticipant {
        public IJavaElementDelta mergeDeltas(Collection deltas) {
                if (deltas.size() == 0) return null;
                if (deltas.size() == 1) return (IJavaElementDelta)deltas.iterator().next();
-               
+
                if (DeltaProcessor.VERBOSE) {
                        System.out.println("MERGING " + deltas.size() + " DELTAS ["+Thread.currentThread()+"]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                }
-               
+
                Iterator iterator = deltas.iterator();
                IJavaElement javaModel = this.getJavaModel();
                JavaElementDelta rootDelta = new JavaElementDelta(javaModel);
@@ -1472,7 +1477,7 @@ public class JavaModelManager implements ISaveParticipant {
                else {
                        return null;
                }
-       }       
+       }
 
        /**
         *  Returns the info for this element without
@@ -1487,14 +1492,14 @@ public class JavaModelManager implements ISaveParticipant {
         */
        public void prepareToSave(ISaveContext context) throws CoreException {
        }
-       
+
        protected void putInfo(IJavaElement element, Object info) {
                this.cache.putInfo(element, info);
        }
        /*
         * Puts the infos in the given map (keys are IJavaElements and values are JavaElementInfos)
         * in the Java model cache in an atomic way.
-        * First checks that the info for the opened element (or one of its ancestors) has not been 
+        * First checks that the info for the opened element (or one of its ancestors) has not been
         * added to the cache. If it is the case, another thread has opened the element (or one of
         * its ancestors). So returns without updating the cache.
         */
@@ -1512,7 +1517,7 @@ public class JavaModelManager implements ISaveParticipant {
                                }
                        }
                }
-       
+
                Iterator iterator = newElements.keySet().iterator();
                while (iterator.hasNext()) {
                        IJavaElement element = (IJavaElement)iterator.next();
@@ -1558,7 +1563,7 @@ public class JavaModelManager implements ISaveParticipant {
 //                     final String projectName = propertyName.substring(containerPrefixLength, index).trim();
 //                     JavaProject project = (JavaProject)getJavaModelManager().getJavaModel().getJavaProject(projectName);
 //                     final IPath containerPath = new Path(propertyName.substring(index+1).trim());
-//                     
+//
 //                     if (containerString == null || containerString.equals(CP_ENTRY_IGNORE)) {
 //                             containerPut(project, containerPath, null);
 //                     } else {
@@ -1572,7 +1577,7 @@ public class JavaModelManager implements ISaveParticipant {
 //                                                     return "Persisted container ["+containerPath+" for project ["+ projectName+"]"; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
 //                                             }
 //                                             public int getKind() {
-//                                                     return 0; 
+//                                                     return 0;
 //                                             }
 //                                             public IPath getPath() {
 //                                                     return containerPath;
@@ -1602,39 +1607,39 @@ public class JavaModelManager implements ISaveParticipant {
        protected void registerJavaModelDelta(IJavaElementDelta delta) {
                this.javaModelDeltas.add(delta);
        }
-       
+
        /**
         * Remembers the given scope in a weak set
         * (so no need to remove it: it will be removed by the garbage collector)
         */
 //     public void rememberScope(AbstractSearchScope scope) {
 //             // NB: The value has to be null so as to not create a strong reference on the scope
-//             this.scopes.put(scope, null); 
+//             this.scopes.put(scope, null);
 //     }
 
        /**
         * removeElementChangedListener method comment.
         */
        public void removeElementChangedListener(IElementChangedListener listener) {
-               
+
                for (int i = 0; i < this.elementChangedListenerCount; i++){
-                       
+
                        if (this.elementChangedListeners[i].equals(listener)){
-                               
+
                                // need to clone defensively since we might be in the middle of listener notifications (#fire)
                                int length = this.elementChangedListeners.length;
                                IElementChangedListener[] newListeners = new IElementChangedListener[length];
                                System.arraycopy(this.elementChangedListeners, 0, newListeners, 0, i);
                                int[] newMasks = new int[length];
                                System.arraycopy(this.elementChangedListenerMasks, 0, newMasks, 0, i);
-                               
+
                                // copy trailing listeners
                                int trailingLength = this.elementChangedListenerCount - i - 1;
                                if (trailingLength > 0){
                                        System.arraycopy(this.elementChangedListeners, i+1, newListeners, i, trailingLength);
                                        System.arraycopy(this.elementChangedListenerMasks, i+1, newMasks, i, trailingLength);
                                }
-                               
+
                                // update manager listener state (#fire need to iterate over original listeners through a local variable to hold onto
                                // the original ones)
                                this.elementChangedListeners = newListeners;
@@ -1644,15 +1649,15 @@ public class JavaModelManager implements ISaveParticipant {
                        }
                }
        }
-       
+
        /**
         * Remembers the given scope in a weak set
         * (so no need to remove it: it will be removed by the garbage collector)
         */
 //     public void rememberScope(AbstractSearchScope scope) {
 //             // NB: The value has to be null so as to not create a strong reference on the scope
-//             this.searchScopes.put(scope, null); 
-//     }       
+//             this.searchScopes.put(scope, null);
+//     }
        /*
         * Removes all cached info for the given element (including all children)
         * from the cache.
@@ -1687,7 +1692,7 @@ public class JavaModelManager implements ISaveParticipant {
                        return info;
                }
                return null;
-       }       
+       }
        public void removePerProjectInfo(JavaProject javaProject) {
                synchronized(perProjectInfo) { // use the perProjectInfo collection as its own lock
                        IProject project = javaProject.getProject();
@@ -1713,11 +1718,11 @@ public class JavaModelManager implements ISaveParticipant {
 
                // passed this point, save actions are non trivial
                if (context.getKind() == ISaveContext.SNAPSHOT) return;
-               
+
                // save built state
                if (info.triedRead) saveBuiltState(info);
        }
-       
+
        /**
         * Saves the built state for the project.
         */
@@ -1758,7 +1763,7 @@ public class JavaModelManager implements ISaveParticipant {
                }
        }
        private synchronized Map containerClone(IJavaProject project) {
-               Map originalProjectContainers = (Map)this.containers.get(project); 
+               Map originalProjectContainers = (Map)this.containers.get(project);
                if (originalProjectContainers == null) return null;
                Map projectContainers = new HashMap(originalProjectContainers.size());
                projectContainers.putAll(originalProjectContainers);
@@ -1768,7 +1773,7 @@ public class JavaModelManager implements ISaveParticipant {
         * @see ISaveParticipant
         */
        public void saving(ISaveContext context) throws CoreException {
-               
+
            // save container values on snapshot/full save
                Preferences preferences = JavaCore.getPlugin().getPluginPreferences();
                IJavaProject[] projects = getJavaModel().getJavaProjects();
@@ -1794,11 +1799,11 @@ public class JavaModelManager implements ISaveParticipant {
                        }
                }
                JavaCore.getPlugin().savePluginPreferences();
-               
+
 //             if (context.getKind() == ISaveContext.FULL_SAVE) {
 //                     // will need delta since this save (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=38658)
 //                     context.needDelta();
-//                     
+//
 //                     // clean up indexes on workspace full save
 //                     // (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=52347)
 //                     IndexManager manager = this.indexManager;
@@ -1806,7 +1811,7 @@ public class JavaModelManager implements ISaveParticipant {
 //                             manager.cleanUpIndexes();
 //                     }
 //             }
-       
+
                IProject savedProject = context.getProject();
                if (savedProject != null) {
                        if (!JavaProject.hasJavaNature(savedProject)) return; // ignore
@@ -1836,7 +1841,7 @@ public class JavaModelManager implements ISaveParticipant {
         * @see ISaveParticipant
         */
 //     public void saving(ISaveContext context) throws CoreException {
-//     
+//
 //             IProject savedProject = context.getProject();
 //             if (savedProject != null) {
 //                     if (!JavaProject.hasJavaNature(savedProject)) return; // ignore
@@ -1872,9 +1877,9 @@ public class JavaModelManager implements ISaveParticipant {
                // optional behaviour
                // possible value of index 0 is Compute
                if (!JavaCore.COMPUTE.equals(JavaCore.getOption(JavaCore.CORE_JAVA_BUILD_ORDER))) return; // cannot be customized at project level
-               
+
                if (javaBuildOrder == null || javaBuildOrder.length <= 1) return;
-               
+
                IWorkspace workspace = ResourcesPlugin.getWorkspace();
                IWorkspaceDescription description = workspace.getDescription();
                String[] wksBuildOrder = description.getBuildOrder();
@@ -1965,7 +1970,7 @@ public class JavaModelManager implements ISaveParticipant {
        public void stopDeltas() {
                this.isFiring= false;
        }
-       
+
        /**
         * Update Java Model given some delta
         */
@@ -1982,7 +1987,7 @@ public class JavaModelManager implements ISaveParticipant {
        }
 
 
-       
+
        public static IPath variableGet(String variableName){
                return (IPath)Variables.get(variableName);
        }
@@ -1997,10 +2002,10 @@ public class JavaModelManager implements ISaveParticipant {
                }
                return result;
        }
-       
-       public static void variablePut(String variableName, IPath variablePath){                
 
-               // update cache - do not only rely on listener refresh          
+       public static void variablePut(String variableName, IPath variablePath){
+
+               // update cache - do not only rely on listener refresh
                if (variablePath == null) {
                        Variables.remove(variableName);
                        PreviousSessionVariables.remove(variableName);
@@ -2011,7 +2016,7 @@ public class JavaModelManager implements ISaveParticipant {
                // do not write out intermediate initialization value
                if (variablePath == JavaModelManager.VariableInitializationInProgress){
                        return;
-               } 
+               }
                Preferences preferences = JavaCore.getPlugin().getPluginPreferences();
                String variableKey = CP_VARIABLE_PREFERENCES_PREFIX+variableName;
                String variableString = variablePath == null ? CP_ENTRY_IGNORE : variablePath.toString();
@@ -2026,8 +2031,8 @@ public class JavaModelManager implements ISaveParticipant {
         */
        public ICompilationUnit[] getWorkingCopies(WorkingCopyOwner owner, boolean addPrimary) {
                synchronized(perWorkingCopyInfos) {
-                       ICompilationUnit[] primaryWCs = addPrimary && owner != DefaultWorkingCopyOwner.PRIMARY 
-                               ? getWorkingCopies(DefaultWorkingCopyOwner.PRIMARY, false) 
+                       ICompilationUnit[] primaryWCs = addPrimary && owner != DefaultWorkingCopyOwner.PRIMARY
+                               ? getWorkingCopies(DefaultWorkingCopyOwner.PRIMARY, false)
                                : null;
                        Map workingCopyToInfos = (Map)perWorkingCopyInfos.get(owner);
                        if (workingCopyToInfos == null) return primaryWCs;
@@ -2043,14 +2048,14 @@ public class JavaModelManager implements ISaveParticipant {
                                result[index++] = ((JavaModelManager.PerWorkingCopyInfo)iterator.next()).getWorkingCopy();
                        }
                        return result;
-               }               
+               }
        }
-       
+
        /*
         * A HashSet that contains the IJavaProject whose classpath is being resolved.
         */
        private ThreadLocal classpathsBeingResolved = new ThreadLocal();
-       
+
        private HashSet getClasspathBeingResolved() {
            HashSet result = (HashSet) this.classpathsBeingResolved.get();
            if (result == null) {
@@ -2062,7 +2067,7 @@ public class JavaModelManager implements ISaveParticipant {
        public boolean isClasspathBeingResolved(IJavaProject project) {
            return getClasspathBeingResolved().contains(project);
        }
-       
+
        public void setClasspathBeingResolved(IJavaProject project, boolean classpathIsResolved) {
            if (classpathIsResolved) {
                getClasspathBeingResolved().add(project);
index b205146..261673f 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Created on 09.08.2003
- *  
+ *
  */
 package net.sourceforge.phpdt.internal.ui.util;
 
@@ -18,44 +18,58 @@ import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.ui.IEditorDescriptor;
+import org.eclipse.ui.IEditorRegistry;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.PlatformUI;
 
 public class PHPFileUtil {
-  private static String[] PHP_EXTENSIONS = null;
+//  private static String[] PHP_EXTENSIONS = null;
 
   public final static String[] SMARTY_EXTENSIONS = { "tpl" };
 
   public static boolean isPHPFile(IFile file) {
-    String extension = file.getFileExtension();
+//    String extension = file.getFileExtension();
     return isPHPFileName(file.getLocation().toString());
   }
 
-  public final static String getFileExtension(String name) {
-    int index = name.lastIndexOf('.');
-    if (index == -1)
-      return null;
-    if (index == (name.length() - 1))
-      return null; //$NON-NLS-1$
-    return name.substring(index + 1);
-  }
+//  public final static String getFileExtension(String name) {
+//    int index = name.lastIndexOf('.');
+//    if (index == -1)
+//      return null;
+//    if (index == (name.length() - 1))
+//      return null; //$NON-NLS-1$
+//    return name.substring(index + 1);
+//  }
 
   /**
    * Returns true iff str.toLowerCase().endsWith(".php") implementation is not creating extra strings.
    */
   public final static boolean isPHPFileName(String name) {
-    String extension = getFileExtension(name);
-    if (extension == null) {
-      return false;
-    }
-    extension = extension.toLowerCase();
-    PHP_EXTENSIONS = getExtensions();
-    if (PHP_EXTENSIONS == null) {
-      return false;
-    }
-    for (int i = 0; i < PHP_EXTENSIONS.length; i++) {
-      if (extension.equals(PHP_EXTENSIONS[i])) {
+
+       IWorkbench workbench = PlatformUI.getWorkbench();
+       IEditorRegistry registry = workbench.getEditorRegistry();
+       IEditorDescriptor[] descriptors = registry.getEditors(name);
+
+       for (int i = 0; i < descriptors.length; i++) {
+                       if (descriptors[i].getId().equals(PHPeclipsePlugin.EDITOR_ID)) {
         return true;
-      }
-    }
+                       }
+               }
+//    String extension = getFileExtension(name);
+//    if (extension == null) {
+//      return false;
+//    }
+//    extension = extension.toLowerCase();
+//    PHP_EXTENSIONS = getExtensions();
+//    if (PHP_EXTENSIONS == null) {
+//      return false;
+//    }
+//    for (int i = 0; i < PHP_EXTENSIONS.length; i++) {
+//      if (extension.equals(PHP_EXTENSIONS[i])) {
+//        return true;
+//      }
+//    }
     return false;
   }
 
@@ -69,43 +83,43 @@ public class PHPFileUtil {
   /**
    * @return Returns the PHP extensions.
    */
-  public static String[] getExtensions() {
-    if (PHP_EXTENSIONS == null) {
-      ArrayList list = new ArrayList();
-      final IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore();
-      String extensions = store.getString(PHPeclipsePlugin.PHP_EXTENSION_PREFS);
-      extensions = extensions.trim();
-      if (extensions.length() != 0) {
-        StringTokenizer tokenizer = new StringTokenizer(extensions, " ,;:/-|");
-        String token;
-        while (tokenizer.hasMoreTokens()) {
-          token = tokenizer.nextToken();
-          if (token != null && token.length() >= 1) {
-            list.add(token);
-          }
-        }
-        if (list.size() != 0) {
-          PHP_EXTENSIONS = new String[list.size()];
-          for (int i = 0; i < list.size(); i++) {
-            PHP_EXTENSIONS[i] = (String) list.get(i);
-          }
-        }
-      }
-    }
-    return PHP_EXTENSIONS;
-  }
+//  public static String[] getExtensions() {
+//    if (PHP_EXTENSIONS == null) {
+//      ArrayList list = new ArrayList();
+//      final IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore();
+//      String extensions = store.getString(PHPeclipsePlugin.PHP_EXTENSION_PREFS);
+//      extensions = extensions.trim();
+//      if (extensions.length() != 0) {
+//        StringTokenizer tokenizer = new StringTokenizer(extensions, " ,;:/-|");
+//        String token;
+//        while (tokenizer.hasMoreTokens()) {
+//          token = tokenizer.nextToken();
+//          if (token != null && token.length() >= 1) {
+//            list.add(token);
+//          }
+//        }
+//        if (list.size() != 0) {
+//          PHP_EXTENSIONS = new String[list.size()];
+//          for (int i = 0; i < list.size(); i++) {
+//            PHP_EXTENSIONS[i] = (String) list.get(i);
+//          }
+//        }
+//      }
+//    }
+//    return PHP_EXTENSIONS;
+//  }
 
   /**
    * @param php_extensions
    *          The PHP extensions to set.
    */
-  public static void setExtensions(String[] php_extensions) {
-    PHP_EXTENSIONS = php_extensions;
-  }
+//  public static void setExtensions(String[] php_extensions) {
+//    PHP_EXTENSIONS = php_extensions;
+//  }
 
   /**
    * Creata the file for the given absolute file path
-   * 
+   *
    * @param absoluteFilePath
    * @param project
    * @return the file for the given absolute file path or <code>null</code> if no existing file can be found
@@ -123,7 +137,7 @@ public class PHPFileUtil {
 
   /**
    * Determine the path of an include name string
-   * 
+   *
    * @param includeNameString
    * @param resource
    * @param project
index 518a3bd..ee2d646 100644 (file)
@@ -37,7 +37,6 @@ import net.sourceforge.phpdt.internal.ui.text.phpdoc.PHPDocCompletionProcessor;
 import net.sourceforge.phpdt.ui.PreferenceConstants;
 import net.sourceforge.phpeclipse.IPreferenceConstants;
 import net.sourceforge.phpeclipse.PHPeclipsePlugin;
-import net.sourceforge.phpeclipse.phpeditor.html.HTMLFormattingStrategy;
 import net.sourceforge.phpeclipse.phpeditor.php.HTMLCompletionProcessor;
 import net.sourceforge.phpeclipse.phpeditor.php.PHPAutoIndentStrategy;
 import net.sourceforge.phpeclipse.phpeditor.php.PHPCodeScanner;
@@ -98,14 +97,14 @@ import org.eclipse.ui.texteditor.ITextEditor;
 public class PHPSourceViewerConfiguration extends SourceViewerConfiguration {
   /**
    * Preference key used to look up display tab width.
-   * 
+   *
    * @since 2.0
    */
   public final static String PREFERENCE_TAB_WIDTH = PreferenceConstants.EDITOR_TAB_WIDTH;
 
   /**
    * Preference key for inserting spaces rather than tabs.
-   * 
+   *
    * @since 2.0
    */
   public final static String SPACES_FOR_TABS = PreferenceConstants.EDITOR_SPACES_FOR_TABS;
@@ -113,21 +112,19 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration {
   //  public static final String HTML_DEFAULT =
   // IPHPPartitionScannerConstants.HTML;
   //IDocument.DEFAULT_CONTENT_TYPE;
-  private JavaTextTools fJavaTextTools;
+//  private JavaTextTools fJavaTextTools;
 
   private ITextEditor fTextEditor;
 
   /**
    * The document partitioning.
-   * 
+   *
    * @since 3.0
    */
   private String fDocumentPartitioning;
 
   private ContentFormatter fFormatter;
 
-  private HTMLFormattingStrategy fFormattingStrategy;
-
   /**
    * Single token scanner.
    */
@@ -139,27 +136,27 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration {
 
   /**
    * The document partitioning.
-   * 
+   *
    * @since 3.0
    */
   //  private String fDocumentPartitioning;
   /**
    * The Java source code scanner
-   * 
+   *
    * @since 3.0
    */
   private AbstractJavaScanner fCodeScanner;
 
   /**
    * The Java multi-line comment scanner
-   * 
+   *
    * @since 3.0
    */
   private AbstractJavaScanner fMultilineCommentScanner;
 
   /**
    * The Java single-line comment scanner
-   * 
+   *
    * @since 3.0
    */
   private AbstractJavaScanner fSinglelineCommentScanner;
@@ -172,24 +169,24 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration {
    * The PHP single quoted string scanner
    */
   private AbstractJavaScanner fStringSQScanner;
-  
+
   /**
    * The Javadoc scanner
-   * 
+   *
    * @since 3.0
    */
   private AbstractJavaScanner fJavaDocScanner;
 
   /**
    * The preference store, can be read-only
-   * 
+   *
    * @since 3.0
    */
   private IPreferenceStore fPreferenceStore;
 
   /**
    * The color manager
-   * 
+   *
    * @since 3.0
    */
   private IColorManager fColorManager;
@@ -206,7 +203,7 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration {
    * {@link JavaSourceViewerConfiguration#handlePropertyChangeEvent(PropertyChangeEvent)}and disallowed to call
    * {@link JavaSourceViewerConfiguration#getPreferenceStore()}on the resulting Java source viewer configuration.
    * </p>
-   * 
+   *
    * @param colorManager
    *          the color manager
    * @param preferenceStore
@@ -236,7 +233,7 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration {
 
   /**
    * Creates a new Java source viewer configuration for viewers in the given editor using the given Java tools.
-   * 
+   *
    * @param tools
    *          the Java text tools to be used
    * @param editor
@@ -261,7 +258,7 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration {
   //  }
   /**
    * Returns the color manager for this configuration.
-   * 
+   *
    * @return the color manager
    */
   protected IColorManager getColorManager() {
@@ -270,11 +267,11 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration {
 
   /**
    * Initializes the scanners.
-   * 
+   *
    * @since 3.0
    */
   private void initializeScanners() {
-    Assert.isTrue(isNewSetup());
+//    Assert.isTrue(isNewSetup());
     fCodeScanner = new PHPCodeScanner(getColorManager(), fPreferenceStore);
     fMultilineCommentScanner = new SingleTokenPHPScanner(getColorManager(), fPreferenceStore,
         IPreferenceConstants.PHP_MULTILINE_COMMENT);
@@ -288,7 +285,7 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration {
 
   /**
    * Determines whether the preference change encoded by the given event changes the behavior of one of its contained components.
-   * 
+   *
    * @param event
    *          the event to be investigated
    * @return <code>true</code> if event causes a behavioral change
@@ -305,14 +302,14 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration {
    * <p>
    * Clients are not allowed to call this method if the old setup with text tools is in use.
    * </p>
-   * 
+   *
    * @param event
    *          the event to which to adapt
    * @see JavaSourceViewerConfiguration#JavaSourceViewerConfiguration(IColorManager, IPreferenceStore, ITextEditor, String)
    * @since 3.0
    */
   public void handlePropertyChangeEvent(PropertyChangeEvent event) {
-    Assert.isTrue(isNewSetup());
+//    Assert.isTrue(isNewSetup());
     if (fCodeScanner.affectsBehavior(event))
       fCodeScanner.adaptToPreferenceChange(event);
     if (fMultilineCommentScanner.affectsBehavior(event))
@@ -354,7 +351,7 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration {
   /**
    * Returns the names of the document position categories used by the document partitioners created by this object to manage their
    * partition information. If the partitioners don't use document position categories, the returned result is <code>null</code>.
-   * 
+   *
    * @return the partition managing position categories or <code>null</code> if there is none
    */
   public String[] getPartitionManagingPositionCategories() {
@@ -383,9 +380,9 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration {
 
   /**
    * Returns the preference store used by this configuration to initialize the individual bits and pieces.
-   * 
+   *
    * @return the preference store used to initialize this configuration
-   * 
+   *
    * @since 2.0
    */
   protected IPreferenceStore getPreferenceStore() {
@@ -417,7 +414,7 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration {
    * (non-Javadoc) Method declared on SourceViewerConfiguration
    */
   public IAutoIndentStrategy getAutoIndentStrategy(ISourceViewer sourceViewer, String contentType) {
-    if (IPHPPartitions.PHP_PHPDOC_COMMENT.equals(contentType) 
+    if (IPHPPartitions.PHP_PHPDOC_COMMENT.equals(contentType)
         || IPHPPartitions.PHP_MULTILINE_COMMENT.equals(contentType))
       return new JavaDocAutoIndentStrategy(getConfiguredDocumentPartitioning(sourceViewer));
     if (IPHPPartitions.PHP_STRING_DQ.equals(contentType))
@@ -433,7 +430,7 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration {
 
   /**
    * Returns the PHP source code scanner for this configuration.
-   * 
+   *
    * @return the PHP source code scanner
    */
   protected RuleBasedScanner getCodeScanner() {
@@ -442,7 +439,7 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration {
 
   /**
    * Returns the Java multi-line comment scanner for this configuration.
-   * 
+   *
    * @return the Java multi-line comment scanner
    * @since 2.0
    */
@@ -452,7 +449,7 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration {
 
   /**
    * Returns the Java single-line comment scanner for this configuration.
-   * 
+   *
    * @return the Java single-line comment scanner
    * @since 2.0
    */
@@ -462,7 +459,7 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration {
 
   /**
    * Returns the PHP double quoted string scanner for this configuration.
-   * 
+   *
    * @return the PHP double quoted string scanner
    */
   protected RuleBasedScanner getStringDQScanner() {
@@ -471,7 +468,7 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration {
 
   /**
    * Returns the PHP single quoted string scanner for this configuration.
-   * 
+   *
    * @return the PHP single quoted string scanner
    */
   protected RuleBasedScanner getStringSQScanner() {
@@ -479,7 +476,7 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration {
   }
   /**
    * Returns the HTML source code scanner for this configuration.
-   * 
+   *
    * @return the HTML source code scanner
    */
   //  protected RuleBasedScanner getHTMLScanner() {
@@ -487,7 +484,7 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration {
   //  }
   /**
    * Returns the Smarty source code scanner for this configuration.
-   * 
+   *
    * @return the Smarty source code scanner
    */
   //  protected RuleBasedScanner getSmartyScanner() {
@@ -581,7 +578,7 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration {
 
   /**
    * Returns the SmartyDoc source code scanner for this configuration.
-   * 
+   *
    * @return the SmartyDoc source code scanner
    */
   //  protected RuleBasedScanner getSmartyDocScanner() {
@@ -589,7 +586,7 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration {
   //  }
   /**
    * Returns the PHPDoc source code scanner for this configuration.
-   * 
+   *
    * @return the PHPDoc source code scanner
    */
   protected RuleBasedScanner getPHPDocScanner() {
@@ -743,28 +740,28 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration {
 
   /**
    * @return <code>true</code> iff the new setup without text tools is in use.
-   * 
+   *
    * @since 3.0
    */
-  private boolean isNewSetup() {
-    return fJavaTextTools == null;
-  }
+//  private boolean isNewSetup() {
+//    return fJavaTextTools == null;
+//  }
 
   /**
    * Creates and returns a preference store which combines the preference stores from the text tools and which is read-only.
-   * 
+   *
    * @return the read-only preference store
    * @since 3.0
    */
-  private IPreferenceStore createPreferenceStore() {
-    Assert.isTrue(!isNewSetup());
-    IPreferenceStore generalTextStore = EditorsUI.getPreferenceStore();
-    if (fJavaTextTools.getCorePreferenceStore() == null)
-      return new ChainedPreferenceStore(new IPreferenceStore[] { fJavaTextTools.getPreferenceStore(), generalTextStore });
-
-    return new ChainedPreferenceStore(new IPreferenceStore[] { fJavaTextTools.getPreferenceStore(),
-        new PreferencesAdapter(fJavaTextTools.getCorePreferenceStore()), generalTextStore });
-  }
+//  private IPreferenceStore createPreferenceStore() {
+//    Assert.isTrue(!isNewSetup());
+//    IPreferenceStore generalTextStore = EditorsUI.getPreferenceStore();
+//    if (fJavaTextTools.getCorePreferenceStore() == null)
+//      return new ChainedPreferenceStore(new IPreferenceStore[] { fJavaTextTools.getPreferenceStore(), generalTextStore });
+//
+//    return new ChainedPreferenceStore(new IPreferenceStore[] { fJavaTextTools.getPreferenceStore(),
+//        new PreferencesAdapter(fJavaTextTools.getCorePreferenceStore()), generalTextStore });
+//  }
 
   /*
    * (non-Javadoc) Method declared on SourceViewerConfiguration
@@ -823,7 +820,7 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration {
     phpReconciler.setRepairer(phpDR, IPHPPartitions.PHP_STRING_DQ);
     phpDR = new DefaultDamagerRepairer(getStringSQScanner());
     phpReconciler.setDamager(phpDR, IPHPPartitions.PHP_STRING_SQ);
-    phpReconciler.setRepairer(phpDR, IPHPPartitions.PHP_STRING_SQ); 
+    phpReconciler.setRepairer(phpDR, IPHPPartitions.PHP_STRING_SQ);
     phpDR = new DefaultDamagerRepairer(getSinglelineCommentScanner());
     phpReconciler.setDamager(phpDR, IPHPPartitions.PHP_SINGLELINE_COMMENT);
     phpReconciler.setRepairer(phpDR, IPHPPartitions.PHP_SINGLELINE_COMMENT);
@@ -834,7 +831,7 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration {
     PresentationReconciler reconciler = new PresentationReconciler();
     reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
     //
-    JavaTextTools jspTextTools = PHPeclipsePlugin.getDefault().getJavaTextTools();
+//    JavaTextTools jspTextTools = PHPeclipsePlugin.getDefault().getJavaTextTools();
     DefaultDamagerRepairer dr = new DefaultDamagerRepairer(getPHPDocScanner());//jspTextTools.getJSPTextScanner());
     reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
     reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
@@ -944,7 +941,7 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration {
   /**
    * Returns the information presenter control creator. The creator is a factory creating the presenter controls for the given
    * source viewer. This implementation always returns a creator for <code>DefaultInformationControl</code> instances.
-   * 
+   *
    * @param sourceViewer
    *          the source viewer to be configured by this configuration
    * @return an information control creator
@@ -964,7 +961,7 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration {
   /**
    * Returns the outline presenter control creator. The creator is a factory creating outline presenter controls for the given
    * source viewer. This implementation always returns a creator for <code>JavaOutlineInformationControl</code> instances.
-   * 
+   *
    * @param sourceViewer
    *          the source viewer to be configured by this configuration
    * @return an information control creator
@@ -982,7 +979,7 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration {
 
   /**
    * Returns the outline presenter which will determine and shown information requested for the current cursor position.
-   * 
+   *
    * @param sourceViewer
    *          the source viewer to be configured by this configuration
    * @param doCodeResolve
index cec00dc..f0f5946 100644 (file)
@@ -18,14 +18,14 @@ package net.sourceforge.phpeclipse;
 public interface IPreferenceConstants {
   /**
    * Preference key suffix for bold text style preference keys.
-   * 
+   *
    * @since 2.1
    */
   public static final String EDITOR_BOLD_SUFFIX = "_bold"; //$NON-NLS-1$
 
   /**
    * Preference key suffix for italic text style preference keys.
-   * 
+   *
    * @since 3.0
    */
   public static final String EDITOR_ITALIC_SUFFIX = "_italic"; //$NON-NLS-1$
@@ -55,9 +55,9 @@ public interface IPreferenceConstants {
 //  public static final String APACHE_RESTART_BACKGROUND = "_apache_restart_background";
 //
 //  public static final String APACHE_RESTART_PREF = "__apache_restart";
-  
+
 //  public static final String HTTPD_CONF_PATH_PREF = "__httpd_conf_path";
-//  
+//
 //  public static final String ETC_HOSTS_PATH_PREF = "__etc_hosts_path";
 
 //  public static final String SHOW_OUTPUT_IN_CONSOLE = "_show_output_in_console";
@@ -66,8 +66,8 @@ public interface IPreferenceConstants {
 //
 //  public static final String EXTERNAL_PARSER_PREF = "_external_parser";
 
-  public static final String PHP_EXTENSION_PREFS = "_php_parser_extensions";
-  
+//  public static final String PHP_EXTENSION_PREFS = "_php_parser_extensions";
+
 //  public static final String PHP_PARSER_DEFAULT = "_php_parser_default";
 
   //  public static final String PHP_INTERNAL_PARSER = "_php_internal_parser";
@@ -83,14 +83,14 @@ public interface IPreferenceConstants {
 
   /**
    * The color key for operators and brackets in PHP code (value <code>"__php_operator"</code>).
-   * 
+   *
    * @since 3.0
    */
   public static final String PHP_OPERATOR = "__php_operator"; //$NON-NLS-1$
 
   /**
    * The color key for {} in PHP code (value <code>"__php_brace_operator"</code>).
-   * 
+   *
    * @since 3.0
    */
   public static final String PHP_BRACE_OPERATOR = "__php_brace_operator"; //$NON-NLS-1$
@@ -100,7 +100,7 @@ public interface IPreferenceConstants {
    * <p>
    * Value is of type <code>String</code>. A RGB color value encoded as a string using class <code>PreferenceConverter</code>
    * </p>
-   * 
+   *
    * @see org.eclipse.jface.resource.StringConverter
    * @see org.eclipse.jface.preference.PreferenceConverter
    * @since 3.0
@@ -112,7 +112,7 @@ public interface IPreferenceConstants {
    * <p>
    * Value is of type <code>Boolean</code>.
    * </p>
-   * 
+   *
    * @since 3.0
    */
   public final static String EDITOR_PHP_OPERATOR_BOLD = PHP_OPERATOR + EDITOR_BOLD_SUFFIX;
@@ -122,7 +122,7 @@ public interface IPreferenceConstants {
    * <p>
    * Value is of type <code>Boolean</code>.
    * </p>
-   * 
+   *
    * @since 3.0
    */
   public final static String EDITOR_PHP_OPERATOR_ITALIC = PHP_OPERATOR + EDITOR_ITALIC_SUFFIX;
@@ -132,7 +132,7 @@ public interface IPreferenceConstants {
    * <p>
    * Value is of type <code>String</code>. A RGB color value encoded as a string using class <code>PreferenceConverter</code>
    * </p>
-   * 
+   *
    * @see org.eclipse.jface.resource.StringConverter
    * @see org.eclipse.jface.preference.PreferenceConverter
    * @since 3.0
@@ -144,7 +144,7 @@ public interface IPreferenceConstants {
    * <p>
    * Value is of type <code>Boolean</code>.
    * </p>
-   * 
+   *
    * @since 3.0
    */
   public final static String EDITOR_PHP_BRACE_OPERATOR_BOLD = PHP_BRACE_OPERATOR + EDITOR_BOLD_SUFFIX;
@@ -154,14 +154,14 @@ public interface IPreferenceConstants {
    * <p>
    * Value is of type <code>Boolean</code>.
    * </p>
-   * 
+   *
    * @since 3.0
    */
   public final static String EDITOR_PHP_BRACE_OPERATOR_ITALIC = PHP_BRACE_OPERATOR + EDITOR_ITALIC_SUFFIX;
 
   /**
    * The color key for keyword 'return' in PHP code (value <code>"__php_keyword_return"</code>).
-   * 
+   *
    * @since 3.0
    */
   public static final String PHP_KEYWORD_RETURN = "__php_keyword_return"; //$NON-NLS-1$
@@ -171,7 +171,7 @@ public interface IPreferenceConstants {
    * <p>
    * Value is of type <code>String</code>. A RGB color value encoded as a string using class <code>PreferenceConverter</code>
    * </p>
-   * 
+   *
    * @see org.eclipse.jface.resource.StringConverter
    * @see org.eclipse.jface.preference.PreferenceConverter
    * @since 3.0
@@ -183,7 +183,7 @@ public interface IPreferenceConstants {
    * <p>
    * Value is of type <code>Boolean</code>.
    * </p>
-   * 
+   *
    * @since 3.0
    */
   public final static String EDITOR_PHP_KEYWORD_RETURN_BOLD = PHP_KEYWORD_RETURN + EDITOR_BOLD_SUFFIX;
@@ -193,7 +193,7 @@ public interface IPreferenceConstants {
    * <p>
    * Value is of type <code>Boolean</code>.
    * </p>
-   * 
+   *
    * @since 3.0
    */
   public final static String EDITOR_PHP_KEYWORD_RETURN_ITALIC = PHP_KEYWORD_RETURN + EDITOR_ITALIC_SUFFIX;
@@ -277,7 +277,7 @@ public interface IPreferenceConstants {
   public static final String PHP_STRING_ITALIC_SQ = "_php_string_sq_italic";
 
   public static final String PHP_STRING_UNDERLINE_SQ = "_php_string_sq_underline";
-  
+
   public static final String PHP_DEFAULT = "_php_default";
 
   public static final String PHP_DEFAULT_BOLD = "_php_default_bold";
@@ -352,7 +352,7 @@ public interface IPreferenceConstants {
   //  public static final String PHP_BOOKMARK_DEFAULT = "_php_bookmark_default";
   //  public static final String PHP_LOCALHOST_PREF = "_php_localhost";
   //  public static final String PHP_DOCUMENTROOT_PREF = "_php_documentroot";
-  //  
+  //
   //  public static final String PHP_AUTO_PREVIEW_DEFAULT = "_auto_preview";
   //  public static final String PHP_BRING_TO_TOP_PREVIEW_DEFAULT = "_bring_to_top_preview";
   //  public static final String PHP_SHOW_HTML_FILES_LOCAL = "_show_html_files_local";
index 8dab12b..e7352d7 100644 (file)
@@ -8,11 +8,11 @@ import org.eclipse.ui.IFolderLayout;
 import org.eclipse.ui.IPageLayout;
 import org.eclipse.ui.IPerspectiveFactory;
 import org.eclipse.ui.console.IConsoleConstants;
-
+import org.eclipse.core.internal.content.ContentType;
 //import org.eclipse.update.internal.ui.UpdatePerspective;
 public class PHPPerspectiveFactory implements IPerspectiveFactory {
   public static final String ID_PROGRESS_VIEW= "org.eclipse.ui.views.ProgressView"; // see bug 63563  //$NON-NLS-1$
-       
+
   public PHPPerspectiveFactory() {
     super();
   }
@@ -33,8 +33,9 @@ public class PHPPerspectiveFactory implements IPerspectiveFactory {
     outputfolder.addPlaceholder(NewSearchUI.SEARCH_VIEW_ID);
     outputfolder.addView(IConsoleConstants.ID_CONSOLE_VIEW);
     outputfolder.addView(IPageLayout.ID_BOOKMARKS);
+    outputfolder.addView(BrowserView.ID_BROWSER);
     outputfolder.addPlaceholder(ID_PROGRESS_VIEW);
-    
+
     layout.addView(IPageLayout.ID_OUTLINE, IPageLayout.RIGHT, (float) 0.75,
         editorArea);
     layout.addActionSet(IDebugUIConstants.LAUNCH_ACTION_SET);
index 699801e..622ca18 100644 (file)
@@ -124,8 +124,9 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon
    * The id of the PHP plugin (value <code>"net.sourceforge.phpeclipse"</code>).
    */
   public static final String PLUGIN_ID = "net.sourceforge.phpeclipse"; //$NON-NLS-1$
+  public static final String EDITOR_ID = PHPeclipsePlugin.PLUGIN_ID+".PHPUnitEditor";
   public static final String ID_PERSPECTIVE = "net.sourceforge.phpeclipse.PHPPerspective"; //$NON-NLS-1$
-       
+
   IWorkspace w;
 
   /**
@@ -145,27 +146,27 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon
 
   /**
    * The key to store customized templates.
-   * 
+   *
    * @since 3.0
    */
   private static final String TEMPLATES_KEY = "net.sourceforge.phpdt.ui.text.custom_templates"; //$NON-NLS-1$
 
   /**
    * The key to store customized code templates.
-   * 
+   *
    * @since 3.0
    */
   private static final String CODE_TEMPLATES_KEY = "net.sourceforge.phpdt.ui.text.custom_code_templates"; //$NON-NLS-1$
 
   /**
    * The key to store whether the legacy templates have been migrated
-   * 
+   *
    * @since 3.0
    */
   //   private static final String TEMPLATES_MIGRATION_KEY= "net.sourceforge.phpdt.ui.text.templates_migrated"; //$NON-NLS-1$
   /**
    * The key to store whether the legacy code templates have been migrated
-   * 
+   *
    * @since 3.0
    */
   //   private static final String CODE_TEMPLATES_MIGRATION_KEY= "net.sourceforge.phpdt.ui.text.code_templates_migrated";
@@ -208,28 +209,28 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon
 
   /**
    * The template context type registry for the java editor.
-   * 
+   *
    * @since 3.0
    */
   private ContextTypeRegistry fContextTypeRegistry;
 
   /**
    * The code template context type registry for the java editor.
-   * 
+   *
    * @since 3.0
    */
   private ContextTypeRegistry fCodeTemplateContextTypeRegistry;
 
   /**
    * The template store for the java editor.
-   * 
+   *
    * @since 3.0
    */
   private TemplateStore fTemplateStore;
 
   /**
    * The coded template store for the java editor.
-   * 
+   *
    * @since 3.0
    */
   private TemplateStore fCodeTemplateStore;
@@ -271,27 +272,27 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon
 
   /**
    * Property change listener on this plugin's preference store.
-   * 
+   *
    * @since 3.0
    */
   //  private IPropertyChangeListener fPropertyChangeListener;
   /**
    * The combined preference store.
-   * 
+   *
    * @since 3.0
    */
   private IPreferenceStore fCombinedPreferenceStore;
 
   /**
    * The extension point registry for the <code>net.sourceforge.phpdt.ui.javaFoldingStructureProvider</code> extension point.
-   * 
+   *
    * @since 3.0
    */
   private JavaFoldingStructureProviderRegistry fFoldingStructureProviderRegistry;
 
   /**
    * Mockup preference store for firing events and registering listeners on project setting changes. FIXME: Temporary solution.
-   * 
+   *
    * @since 3.0
    */
   private MockupPreferenceStore fMockupPreferenceStore;
@@ -327,7 +328,7 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon
   //  }
   /**
    * Returns all Java editor text hovers contributed to the workbench.
-   * 
+   *
    * @return an array of JavaEditorTextHoverDescriptor
    * @since 2.1
    */
@@ -414,7 +415,7 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon
    * <p>
    * This will force a rebuild of the descriptors the next time a client asks for them.
    * </p>
-   * 
+   *
    * @return an array of JavaEditorTextHoverDescriptor
    * @since 2.1
    */
@@ -452,7 +453,7 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon
   /**
    * Returns an array of all editors that have an unsaved content. If the identical content is presented in more than one editor,
    * only one of those editor parts is part of the result.
-   * 
+   *
    * @return an array of all dirty editor parts.
    */
   public static IEditorPart[] getDirtyEditors() {
@@ -563,19 +564,19 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon
   public static void log(Throwable t) {
          log(error(t));
   }
-  
+
   public static void log(String message, Throwable t) {
-    log(error(message, t)); 
+    log(error(message, t));
   }
 
   public static void logErrorMessage(String message) {
     log(new Status(IStatus.ERROR, getPluginId(), IJavaStatusConstants.INTERNAL_ERROR, message, null));
   }
-  
+
   public static IStatus error(Throwable t) {
          return error("PHPeclipsePlugin.internalErrorOccurred", t); //$NON-NLS-1$
   }
-  
+
   public static IStatus error(String message, Throwable t) {
          return new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, message, t);
   }
@@ -617,7 +618,7 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon
 
   /**
    * Get the identifier index manager for the given project
-   * 
+   *
    * @param iProject
    *          the current project
    * @return
@@ -632,7 +633,7 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon
 //      e.printStackTrace();
 //    } catch (SQLException e) {
 //      e.printStackTrace();
-//    } 
+//    }
     IdentifierIndexManager indexManager = (IdentifierIndexManager) fIndexManagerMap.get(indexFilename);
     if (indexManager == null) {
       indexManager = new IdentifierIndexManager(indexFilename);
@@ -758,8 +759,8 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon
       //    store.setDefault(EXTERNAL_BROWSER_PREF, "netscape {0}");
 //    }
 
-    store.setDefault(PHP_EXTENSION_PREFS, "php,php3,php4,php5,phtml,inc,module,class");
-    
+//    store.setDefault(PHP_EXTENSION_PREFS, "php,php3,php4,php5,phtml,inc,module,class");
+
     //    store.setDefault(PHP_PARSER_DEFAULT, PHP_EXTERNAL_PARSER);
     //    store.setDefault(PHP_INTERNAL_PARSER, "false");
     //    store.setDefault(PHP_EXTERNAL_PARSER, "true");
@@ -780,8 +781,8 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon
     PreferenceConverter.setDefault(store, PHP_CONSTANT, PHPColorProvider.CONSTANT);
     PreferenceConverter.setDefault(store, PHP_TYPE, PHPColorProvider.TYPE);
 //    PreferenceConverter.setDefault(store, PHP_STRING_DQ, PHPColorProvider.STRING_DQ);
-//    store.setDefault(PHP_STRING_BOLD_DQ, true); 
-//    PreferenceConverter.setDefault(store, PHP_STRING_SQ, PHPColorProvider.STRING_SQ); 
+//    store.setDefault(PHP_STRING_BOLD_DQ, true);
+//    PreferenceConverter.setDefault(store, PHP_STRING_SQ, PHPColorProvider.STRING_SQ);
     PreferenceConverter.setDefault(store, PHP_DEFAULT, PHPColorProvider.DEFAULT);
     PreferenceConverter.setDefault(store, PHPDOC_KEYWORD, PHPColorProvider.PHPDOC_KEYWORD);
     PreferenceConverter.setDefault(store, PHPDOC_TAG, PHPColorProvider.PHPDOC_TAG);
@@ -863,7 +864,7 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon
 
   /**
    * Open a file in the Workbench that may or may not exist in the workspace. Must be run on the UI thread.
-   * 
+   *
    * @param filename
    * @throws CoreException
    */
@@ -909,7 +910,7 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon
 
   /**
    * Open a file in the Workbench that may or may not exist in the workspace. Must be run on the UI thread.
-   * 
+   *
    * @param filename
    * @param line
    * @throws CoreException
@@ -932,7 +933,7 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon
 
   /**
    * Open a file in the Workbench that may or may not exist in the workspace. Must be run on the UI thread.
-   * 
+   *
    * @param filename
    * @param offset
    * @throws CoreException
@@ -1328,9 +1329,9 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon
 
   /**
    * Returns a combined preference store, this store is read-only.
-   * 
+   *
    * @return the combined preference store
-   * 
+   *
    * @since 3.0
    */
   public IPreferenceStore getCombinedPreferenceStore() {
@@ -1353,7 +1354,7 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon
   /**
    * Returns the registry of the extensions to the <code>net.sourceforge.phpdt.ui.javaFoldingStructureProvider</code> extension
    * point.
-   * 
+   *
    * @return the registry of contributed <code>IJavaFoldingStructureProvider</code>
    * @since 3.0
    */
@@ -1377,7 +1378,7 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon
    * <p>
    * If this method is called in the dynamic scope of another such call, this method simply runs the action.
    * </p>
-   * 
+   *
    * @param action
    *          the action to perform
    * @param monitor
@@ -1408,7 +1409,7 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon
    * The supplied scheduling rule is used to determine whether this operation can be run simultaneously with workspace changes in
    * other threads. See <code>IWorkspace.run(...)</code> for more details.
    * </p>
-   * 
+   *
    * @param action
    *          the action to perform
    * @param rule
@@ -1433,7 +1434,7 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon
 
   /**
    * Returns the template context type registry for the java plugin.
-   * 
+   *
    * @return the template context type registry for the java plugin
    * @since 3.0
    */
@@ -1451,7 +1452,7 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon
 
   /**
    * Returns the template store for the java editor templates.
-   * 
+   *
    * @return the template store for the java editor templates
    * @since 3.0
    */
@@ -1478,7 +1479,7 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon
 
   /**
    * Returns the template context type registry for the code generation templates.
-   * 
+   *
    * @return the template context type registry for the code generation templates
    * @since 3.0
    */
@@ -1494,7 +1495,7 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon
 
   /**
    * Returns the template store for the code generation templates.
-   * 
+   *
    * @return the template store for the code generation templates
    * @since 3.0
    */
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/html/HTMLFormatter.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/html/HTMLFormatter.java
deleted file mode 100644 (file)
index e995bef..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
- package net.sourceforge.phpeclipse.phpeditor.html;
-
-import java.io.StringWriter;
-import java.util.HashSet;
-import java.util.Set;
-
-import net.sourceforge.phpdt.ui.text.PHPSourceViewerConfiguration;
-import net.sourceforge.phpeclipse.PHPeclipsePlugin;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.text.source.SourceViewer;
-import org.eclipse.ui.texteditor.ITextEditor;
-
-/**
- * Modified from the XMLFormatter.  Some tags in HTML do not indent.
- * 
- * @fixme The HTML parser cannot recognize < tag> as tag due to the extra space.
- * 
- * @author chrisl
- */
-public class HTMLFormatter implements IHTMLConstants {
-
-       ////////////////////////////////////////////////////////////////////////
-
-       private static final String NAME = "HTMLFormatter";
-       private static final boolean TRACE = false;
-//     private static boolean VERBOSE = false;
-
-       private static Set fBLOCK_TAG_SET;
-       private static Set fSTART_TAG_SET;
-       static {
-               fBLOCK_TAG_SET = new HashSet();
-               for (int i = 0; i < BLOCK_TAGS.length; ++i)
-                       fBLOCK_TAG_SET.add(BLOCK_TAGS[i]);
-               //
-               fSTART_TAG_SET = new HashSet();
-               for (int i = 0; i < START_TAGS.length; ++i)
-                       fSTART_TAG_SET.add(START_TAGS[i]);
-       }
-
-       ////////////////////////////////////////////////////////////////////////
-
-       private PHPSourceViewerConfiguration fConfig;
-       private SourceViewer fViewer;
-       //
-       private ITextEditor fEditor;
-       private String fFilename;
-
-       ////////////////////////////////////////////////////////////////////////
-
-       /**
-        * Constructor for XMLFormatter.
-        */
-       public HTMLFormatter(PHPSourceViewerConfiguration cf, SourceViewer viewer) {
-               fConfig=cf;
-               fViewer = viewer;
-               //
-               fEditor = fConfig.getEditor();
-       }
-
-       ////////////////////////////////////////////////////////////////////////
-
-       /** 
-        * Formats the String <code>sourceString</code>,
-        * and returns a string containing the formatted version.
-        * 
-        * @param string the string to format
-        * @param indentationLevel the initial indentation level, used 
-        *      to shift left/right the entire source fragment. An initial indentation
-        *      level of zero has no effect.
-        * @param positions an array of positions to map. These are
-        *      character-based source positions inside the original source,
-        *     for which corresponding positions in the formatted source will
-        *     be computed (so as to relocate elements associated with the original
-        *     source). It updates the positions array with updated positions.
-        *     If set to <code>null</code>, then no positions are mapped.
-        * @param lineSeparator the line separator to use in formatted source,
-        *     if set to <code>null</code>, then the platform default one will be used.
-        * @return the formatted output string.
-        */
-       public String format(
-               String string,
-               int indentationLevel,
-               int[] positions,
-               String lineSeparator,
-               String inputname) {
-               StringWriter ret = new StringWriter(2048);
-               try {
-                       if (PHPeclipsePlugin.DEBUG) {
-                               System.err.println(NAME + ".format(): inputname=" + inputname);
-                       }
-//                     TidyHTMLParser parser = new TidyHTMLParser(new TidyConfiguration(fEditor, fViewer));
-//                     parser.setCompactFormat(
-//                             ((Boolean) fViewer.getData(IConstants.KEY_COMPACT_FORMAT)).booleanValue());
-//                     parser.parse(new StringReader(string), inputname, new PrintWriter(ret));
-//                     if (parser.getParseErrors() != 0) {
-//        PHPeclipsePlugin.log(IStatus.INFO, "Parse error");
-//                             return string;
-//                     }
-                       return ret.toString();
-               } catch (Exception e) {
-               //      PHPeclipsePlugin.error("Unknown parse error: "+e.getMessage(), null, fEditor.getEditorInput(), fViewer);
-      PHPeclipsePlugin.log(IStatus.ERROR, e.getMessage());
-                       return string;
-               }
-       }
-
-}
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/html/HTMLFormattingStrategy.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/html/HTMLFormattingStrategy.java
deleted file mode 100644 (file)
index eba86b6..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-package net.sourceforge.phpeclipse.phpeditor.html;
-
-import net.sourceforge.phpdt.ui.text.PHPSourceViewerConfiguration;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.formatter.IFormattingStrategy;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.text.source.SourceViewer;
-import org.eclipse.ui.texteditor.ITextEditor;
-
-/**
- * @author chrisl
- *
- * To change this generated comment edit the template variable "typecomment":
- * Window>Preferences>Java>ObfuscatorIgnores.
- * To enable and disable the creation of type comments go to
- * Window>Preferences>Java>Code Generation.
- */
-public class HTMLFormattingStrategy implements IFormattingStrategy, IHTMLConstants {
-
-       ////////////////////////////////////////////////////////////////////////
-
-       private PHPSourceViewerConfiguration fConfig;
-       private ISourceViewer fViewer;
-       //
-       private ITextEditor fEditor;
-       private int fTabWidth;
-
-       ////////////////////////////////////////////////////////////////////////
-
-       public HTMLFormattingStrategy(PHPSourceViewerConfiguration cf, ISourceViewer viewer) {
-               fConfig = cf;
-               fViewer = viewer;
-               //
-               fEditor = fConfig.getEditor();
-               initPreferences();
-       }
-
-       public void initPreferences() {
-               fTabWidth=fConfig.getTabWidth(fViewer);
-       }
-       
-       ////////////////////////////////////////////////////////////////////////
-
-       /**
-        * @see IFormattingStrategy#formatterStarts(String)
-        */
-       public void formatterStarts(String initialIndentation) {
-       }
-
-       /**
-        * @see IFormattingStrategy#formatterStops()
-        */
-       public void formatterStops() {
-       }
-
-       /**
-        * @see IFormattingStrategy#format(String, boolean, String, int[])
-        */
-       public String format(String content, boolean isLineStart, String indentation, int[] positions) {
-               HTMLFormatter formatter = new HTMLFormatter(fConfig, (SourceViewer) fViewer);
-               IDocument doc = fViewer.getDocument();
-               String lineDelimiter = getLineDelimiterFor(doc);
-               int indent = 0;
-               if (indentation != null) {
-                       indent = computeIndent(indentation, fTabWidth);
-               }
-               return formatter.format(content, indent, positions, lineDelimiter, fEditor.getEditorInput().getName());
-       }
-
-       public static String getLineDelimiterFor(IDocument doc) {
-               String lineDelim = null;
-               try {
-                       lineDelim = doc.getLineDelimiter(0);
-               } catch (BadLocationException e) {
-               }
-               if (lineDelim == null) {
-                       String systemDelimiter = System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
-                       String[] lineDelims = doc.getLegalLineDelimiters();
-                       for (int i = 0; i < lineDelims.length; i++) {
-                               if (lineDelims[i].equals(systemDelimiter)) {
-                                       lineDelim = systemDelimiter;
-                                       break;
-                               }
-                       }
-                       if (lineDelim == null) {
-                               lineDelim = lineDelims.length > 0 ? lineDelims[0] : systemDelimiter;
-                       }
-               }
-               return lineDelim;
-       }
-
-       /**
-        * Returns the indent of the given string.
-        * 
-        * @param line the text line
-        * @param tabWidth the width of the '\t' character.
-        * 
-        * @see net.sourceforge.phpdt.internal.corext.util.Strings.computeIndent(String,int)
-        */
-       public static int computeIndent(String line, int tabWidth) {
-               int result = 0;
-               int blanks = 0;
-               int size = line.length();
-               for (int i = 0; i < size; i++) {
-                       char c = line.charAt(i);
-                       if (c == '\t') {
-                               result++;
-                               blanks = 0;
-                       } else if (Character.isSpaceChar(c)) {
-                               blanks++;
-                               if (blanks == tabWidth) {
-                                       result++;
-                                       blanks = 0;
-                               }
-                       } else {
-                               return result;
-                       }
-               }
-               return result;
-       }
-
-       ////////////////////////////////////////////////////////////////////////
-
-}
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/html/IHTMLConstants.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/html/IHTMLConstants.java
deleted file mode 100644 (file)
index 96cc755..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-package net.sourceforge.phpeclipse.phpeditor.html;
-
-
-/**
- * @author chrisl
- */
-public interface IHTMLConstants {
-
-       int NONE=0;
-       int TEXT=1;
-       int FOLDER=2;
-       int ANCHOR=3;
-       
-       /** 
-        * Tags that do not allow end tag.
-        * Required that tags that allow optional end tag should always have end tag.
-        */
-       String[] EMPTY_TAGS =
-               new String[] {
-                       "AREA",
-                       "BASE",
-                       "BASEFONT",
-                       "BR",
-                       "COL",
-                       "FRAME",
-                       "HR",
-                       "IMG",
-                       "INPUT",
-                       "ISINDEX",
-                       "LINK",
-                       "META",
-                       "PARAM",
-                       };
-
-       String[] START_TAGS =
-               new String[] {
-                       "A",
-                       "ADDRESS",
-                       "APPLET",
-                       "B",
-                       "BIG",
-                       "BLOCKQUOTE",
-                       "BODY",
-                       "CAPTION",
-                       "CENTER",
-                       "CITE",
-                       "CODE",
-                       "COL",
-                       "COLGROUP",
-                       "DD",
-                       "DFN",
-                       "DIR",
-                       "DIV",
-                       "DL",
-                       "DT",
-                       "EM",
-                       "FONT",
-                       "FORM",
-                       "FRAMESET",
-                       "H1",
-                       "H2",
-                       "H3",
-                       "H4",
-                       "H5",
-                       "H6",
-                       "HEAD",
-                       "HTML",
-                       "I",
-                       "KBD",
-                       "LI",
-                       "MAP",
-                       "MENU",
-                       "NOBR",
-                       "NOFRAMES",
-                       "OBJECT",
-                       "OL",
-                       "OPTION",
-                       "P",
-                       "PRE",
-                       "SAMP",
-                       "SCRIPT",
-                       "SELECT",
-                       "SMALL",
-                       "SPAN",
-                       "STRIKE",
-                       "S",
-                       "STRONG",
-                       "STYLE",
-                       "SUB",
-                       "SUP",
-                       "TABLE",
-                       "TD",
-                       "TEXTAREA",
-                       "TH",
-                       "TITLE",
-                       "TR",
-                       "TT",
-                       "U",
-                       "UL",
-                       "VAR",
-                       };
-
-       /** Line break before and after tag. */
-       String[] BLOCK_TAGS =
-               new String[] {
-                       "A",
-                       "APPLET",
-                       "AREA",
-                       "BASE",
-                       "BASEFONT",
-                       "BLOCKQUOTE",
-                       "BODY",
-                       "BR",
-                       "CAPTION",
-                       "CITE",
-                       "CODE",
-                       "DD",
-                       "DFN",
-                       "DIR",
-                       "DIV",
-                       "DL",
-                       "DT",
-                       "FORM",
-                       "FRAME",
-                       "FRAMESET",
-                       "H1",
-                       "H2",
-                       "H3",
-                       "H4",
-                       "H5",
-                       "H6",
-                       "HEAD",
-                       "HR",
-                       "HTML",
-                       "IMG",
-                       "INPUT",
-                       "ISINDEX",
-                       "LI",
-                       "LINK",
-                       "MAP",
-                       "MENU",
-                       "META",
-                       "NOBR",
-                       "NOFRAMES",
-                       "OBJECT",
-                       "OL",
-                       "OPTION",
-                       "P",
-                       "PARAM",
-                       "PRE",
-                       "SAMP",
-                       "SCRIPT",
-                       "SELECT",
-                       "STRIKE",
-                       "TABLE",
-                       "TD",
-                       "TEXTAREA",
-                       "TH",
-                       "TITLE",
-                       "TR",
-                       "UL",
-                       };
-}
index a4581f8..62687dd 100644 (file)
@@ -8,7 +8,7 @@
  Contributors:
  Igor Malinin - initial contribution
 
- $Id: PHPPartitionScanner.java,v 1.29 2005-05-15 23:24:41 axelcl Exp $
+ $Id: PHPPartitionScanner.java,v 1.30 2005-09-30 18:10:36 axelcl Exp $
  **********************************************************************/
 package net.sourceforge.phpeclipse.phpeditor.php;
 
@@ -26,8 +26,8 @@ import org.eclipse.jface.text.rules.IToken;
 import org.eclipse.jface.text.rules.Token;
 
 /**
- * 
- * 
+ *
+ *
  * @author Igor Malinin
  */
 public class PHPPartitionScanner implements IPartitionTokenScanner {
@@ -40,7 +40,7 @@ public class PHPPartitionScanner implements IPartitionTokenScanner {
 
   private IDocument document;
 
-  private int begin;
+//  private int begin;
 
   private int end;
 
@@ -50,7 +50,7 @@ public class PHPPartitionScanner implements IPartitionTokenScanner {
 
   private int position;
 
-  private int state;
+//  private int state;
 
   private Map tokens = new HashMap();
 
@@ -69,13 +69,13 @@ public class PHPPartitionScanner implements IPartitionTokenScanner {
 
     switch (read()) {
     case ICharacterScanner.EOF:
-      state = STATE_DEFAULT;
+//      state = STATE_DEFAULT;
       return getToken(null);
 
     case '<':
       switch (read()) {
       case ICharacterScanner.EOF:
-        state = STATE_DEFAULT;
+//        state = STATE_DEFAULT;
         return getToken(null);
 
       case '?': // <?
@@ -95,13 +95,13 @@ public class PHPPartitionScanner implements IPartitionTokenScanner {
     loop: while (true) {
       switch (read()) {
       case ICharacterScanner.EOF:
-        state = STATE_DEFAULT;
+//        state = STATE_DEFAULT;
         return getToken(null);
 
       case '<':
         switch (read()) {
         case ICharacterScanner.EOF:
-          state = STATE_DEFAULT;
+//          state = STATE_DEFAULT;
           return getToken(null);
 
         case '?':
@@ -117,7 +117,7 @@ public class PHPPartitionScanner implements IPartitionTokenScanner {
 
         unread();
 
-        state = STATE_DEFAULT;
+//        state = STATE_DEFAULT;
         return getToken(null);
       }
     }
@@ -128,19 +128,19 @@ public class PHPPartitionScanner implements IPartitionTokenScanner {
     while (true) {
       switch (ch) {
       case ICharacterScanner.EOF:
-        state = STATE_DEFAULT;
+//        state = STATE_DEFAULT;
         return getToken(token);
       case '"': // double quoted string
         // read until end of double quoted string
         if (!readUntilEscapedDQ()) {
-          state = STATE_DEFAULT;
+//          state = STATE_DEFAULT;
           return getToken(token);
         }
         break;
       case '\'': // single quoted string
         // read until end of single quoted string
         if (!readUntilEscapedSQ()) {
-          state = STATE_DEFAULT;
+//          state = STATE_DEFAULT;
           return getToken(token);
         }
         break;
@@ -152,14 +152,14 @@ public class PHPPartitionScanner implements IPartitionTokenScanner {
         case '/':
           // read until end of line
           if (!readSingleLine()) {
-            state = STATE_DEFAULT;
+//            state = STATE_DEFAULT;
             return getToken(token);
           }
           break;
         case '*':
           // read until end of comment
           if (!readMultiLineComment()) {
-            state = STATE_DEFAULT;
+//            state = STATE_DEFAULT;
             return getToken(token);
           }
           break;
@@ -170,7 +170,7 @@ public class PHPPartitionScanner implements IPartitionTokenScanner {
       case '#': // line comment
         // read until end of line
         if (!readSingleLine()) {
-          state = STATE_DEFAULT;
+//          state = STATE_DEFAULT;
           return getToken(token);
         }
         break;
@@ -179,7 +179,7 @@ public class PHPPartitionScanner implements IPartitionTokenScanner {
         switch (ch) {
         case ICharacterScanner.EOF:
         case '>':
-          state = STATE_DEFAULT;
+//          state = STATE_DEFAULT;
           return getToken(token);
 
         case '?':
@@ -207,7 +207,7 @@ public class PHPPartitionScanner implements IPartitionTokenScanner {
 //        e.printStackTrace();
 //      }
 //    }
-    
+
     if (type == null) {
       return Token.UNDEFINED;
     }
@@ -257,16 +257,16 @@ public class PHPPartitionScanner implements IPartitionTokenScanner {
     }
     return false;
   }
-  
+
   private boolean readUntilEscapedSQ() {
     // search last single quoted character
-    try {  
+    try {
       char ch;
       while (true) {
         if (position >= end) {
           return false;
         }
-        ch = document.getChar(position++); 
+        ch = document.getChar(position++);
         if (ch == '\\') {
           if (position >= end) {
             return false;
@@ -288,7 +288,7 @@ public class PHPPartitionScanner implements IPartitionTokenScanner {
         if (position >= end) {
           return false;
         }
-      } while (document.getChar(position++) != '\n'); 
+      } while (document.getChar(position++) != '\n');
       return true;
     } catch (BadLocationException e) {
       --position;
@@ -346,7 +346,7 @@ public class PHPPartitionScanner implements IPartitionTokenScanner {
    */
   public void setRange(IDocument document, int offset, int length) {
     this.document = document;
-    this.begin = offset;
+//    this.begin = offset;
     this.end = offset + length;
 
     this.offset = offset;
@@ -358,7 +358,7 @@ public class PHPPartitionScanner implements IPartitionTokenScanner {
    * @see org.eclipse.jface.text.rules.IPartitionTokenScanner
    */
   public void setPartialRange(IDocument document, int offset, int length, String contentType, int partitionOffset) {
-    state = STATE_DEFAULT;
+//    state = STATE_DEFAULT;
     if (partitionOffset > -1) {
       int delta = offset - partitionOffset;
       if (delta > 0) {
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/Partition.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/Partition.java
deleted file mode 100644 (file)
index 4c260bf..0000000
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Created on 28.04.2003
- *
- */
-package net.sourceforge.phpeclipse.phpeditor.php;
-
-import net.sourceforge.phpdt.internal.ui.text.IPHPPartitions;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.rules.ICharacterScanner;
-import org.eclipse.jface.text.rules.IToken;
-import org.eclipse.jface.text.rules.Token;
-
-
-/**
- * Defines a partition in a phpdocument. This class keeps tracks of
- * partitions contained within other partitions.
- * 
- * @author Stefan Langer
- * @version $Revision: 1.4 $
- */
-public abstract class Partition
-{
-       private IDocument fDocument;
-       private IToken fContentToken;
-       private String fParentPartition;
-       private char[] fTextBuffer;
-       private int fOffset = 0;
-       private char entry;
-       private char exit;
-       private boolean inDoubleString = false;
-       private boolean inSingleString = false;
-       
-       public Partition(IDocument document, char[] delim, String contentType, String parentPartition)
-       {
-               fDocument = document;
-               fContentToken = new Token(contentType);
-               fParentPartition = parentPartition;
-               entry = delim[0];
-               exit = delim[1];
-       }
-       
-       public Partition(IDocument document, char[] delim, String contentType)
-       {
-               this(document, delim, contentType, IPHPPartitions.HTML);
-       }
-       
-       /**
-        * Checks wether the specified type is allowed within this 
-        * partition type.
-        * 
-     * @param type The type of the partition to check.
-     * 
-     * @return <code>true</code> if the partition is allowed within this
-     *                         partition otherwise <code>false</code>.
-     */
-    abstract protected boolean allowedPartition(String type);
-    
-    abstract protected boolean scan();
-    
-    protected boolean isEnd()
-    {
-       return fOffset >= fTextBuffer.length;           
-    }
-    
-    protected int read()
-    {
-       if(fOffset > fTextBuffer.length)
-               return ICharacterScanner.EOF;
-       
-       char ret = fTextBuffer[fOffset++];
-       switch(ret)
-       {
-               case '\'':
-                       if(!inDoubleString)
-                               inSingleString = !inSingleString;
-                       break;
-               case '"':
-                       if(!inSingleString)
-                               inDoubleString = !inDoubleString;
-                       break;
-       }
-       return ret;
-    }
-    
-    protected void unread(int i)
-    {
-        for (int j = 0; j < i && fOffset > 0; j++)
-        {
-            char read = fTextBuffer[--fOffset];
-
-            switch (read)
-            {
-                case '\'' :
-                    if (!inDoubleString)
-                        inSingleString = !inSingleString;
-                    break;
-                case '"' :
-                    if (!inSingleString)
-                        inDoubleString = !inDoubleString;
-                    break;
-            }
-        } // END FOR
-    }
-    
-    public boolean scanRange(int offset, int length)
-        throws BadLocationException
-    {  // short circuit scanning if entry is not correct
-        if (fDocument.getChar(offset) != entry)
-            return false;
-               // read the full range into the internal buffer
-               fOffset = 0;
-               inSingleString = false;
-               inDoubleString = false;
-        fTextBuffer = fDocument.get(offset, length).toCharArray();
-        return scan();
-    }
-    
-    protected boolean checkPattern(String pattern, boolean ignoreCase)
-    {
-       char[] checkPattern = pattern.toCharArray();
-       int offset = fOffset;
-       for(int i=0; i<checkPattern.length; i++)
-       {
-               if(isEnd() || !letterEquals(read(), checkPattern[i], ignoreCase))
-               {
-                       fOffset = offset;
-                       return false;
-               }
-       }
-       return true;
-    }
-       
-       private boolean letterEquals(int test, char letter, boolean ignoreCase)
-       {
-               if (test == letter)
-                       return true;
-               else if (
-                       ignoreCase
-                               && Character.isLowerCase(letter)
-                               && test == Character.toUpperCase(letter))
-                       return true;
-               else if (
-                       ignoreCase
-                               && Character.isUpperCase(letter)
-                               && test == Character.toLowerCase(letter))
-                       return true;
-
-               return false;
-       }
-    
-
-    
-    protected boolean inString()
-    {
-       return inDoubleString || inSingleString;
-    }
-    
-    
-    
-    
-    public IToken getToken()
-    {
-               return fContentToken;
-    }
-    
-    public int getLength()
-    {
-       return fOffset;
-    }
-    
-    /**
-     * @return
-     */
-    public IDocument getDocument()
-    {
-        return fDocument;
-    }
-
-    /**
-     * @return
-     */
-    public String getParentPartition()
-    {
-        return fParentPartition;
-    }
-
-    /**
-     * @param document
-     */
-    public void setDocument(IDocument document)
-    {
-        fDocument = document;
-    }
-
-    /**
-     * @param string
-     */
-    public void setParentPartition(String string)
-    {
-        fParentPartition = string;
-    }
-    
-    
-    /**
-     * @return
-     */
-    public char getEntry()
-    {
-        return entry;
-    }
-
-    /**
-     * @return
-     */
-    public char getExit()
-    {
-        return exit;
-    }
-
-    /**
-     * @return
-     */
-    protected int getOffset()
-    {
-        return fOffset;
-    }
-
-    /**
-     * @param i
-     */
-    protected void setOffset(int i)
-    {
-        fOffset = i;
-    }
-
-}
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PartitionStack.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PartitionStack.java
deleted file mode 100644 (file)
index cb7bf66..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Created on 28.04.2003
- *
- */
-package net.sourceforge.phpeclipse.phpeditor.php;
-
-import java.util.ArrayList;
-
-import net.sourceforge.phpdt.internal.ui.text.IPHPPartitions;
-
-import org.eclipse.jface.text.IDocument;
-
-/**
- * A stack for keeping track of the contenttypes for partitions that 
- * contain other partitions.
- * 
- * @author Stefan Langer
- * @version $Revision: 1.4 $
- */
-public class PartitionStack
-{
-    private ArrayList fPartitionStack = new ArrayList(5);
-    private int fStackTop = -1;
-    
-    /**
-     * Pushes the specified contenttype onto the partitionstack. 
-     * This will keep track of the last partitions read.
-     * @param contentType The contenttype to push onto the stack.
-     */
-    public void pushStack(String contentType)
-    {
-       if(fStackTop < fPartitionStack.size())
-       {
-               fPartitionStack.add(++fStackTop, contentType);
-       }
-    }
-    /**
-     * Returns the contentype of the last partition on the partition stack.
-     * If no partition is currently on the stack this function simply returns
-     * the HTML contenttype as default.
-     * @return The contenttype of the last partition on stack.
-     */
-    public String popStack()
-    {
-       if(fStackTop >= 0)
-       {
-               return (String)fPartitionStack.get(fStackTop--);
-       }
-       
-       return IPHPPartitions.HTML;
-    }
-    
-    public boolean isEmpty()
-    {
-       return (fStackTop < 0);
-    }
-    
-    /**
-     * Initializes this stack from the specified document for the
-     * specified offset.
-     * @param offset           The offset to initialize from
-     * @param fDocument        The document to initialize from
-     */
-    public void initializeStack(int offset, IDocument fDocument)
-    {
-       
-    }
-
-}