import net.sourceforge.phpeclipse.phpeditor.php.PHPPartitionScanner;
/**
- * The JavaDocumentProvider provides the IDocuments used by java editors.
+ * The PHPDocumentProvider provides the IDocuments used by java editors.
*/
public class PHPDocumentProvider extends FileDocumentProvider {
- // private final static String[] TYPES= new String[] { PHPPartitionScanner.PHP, PHPPartitionScanner.JAVA_DOC, PHPPartitionScanner.JAVA_MULTILINE_COMMENT };
-private final static String[] TYPES= new String[] { PHPPartitionScanner.PHP, PHPPartitionScanner.JAVA_MULTILINE_COMMENT };
+ // private final static String[] TYPES= new String[] { PHPPartitionScanner.PHP, PHPPartitionScanner.JAVA_DOC, PHPPartitionScanner.JAVA_MULTILINE_COMMENT };
+ private final static String[] TYPES = new String[] {
+ PHPPartitionScanner.PHP,
+// PHPPartitionScanner.HTML,
+ PHPPartitionScanner.HTML_MULTILINE_COMMENT };
- private static PHPPartitionScanner fgScanner= null;
+ private static PHPPartitionScanner fgScanner = null;
- public PHPDocumentProvider() {
- super();
- }
-
- /* (non-Javadoc)
- * Method declared on AbstractDocumentProvider
- */
- protected IDocument createDocument(Object element) throws CoreException {
- IDocument document= super.createDocument(element);
- if (document != null) {
- IDocumentPartitioner partitioner= createJavaPartitioner();
- document.setDocumentPartitioner(partitioner);
- partitioner.connect(document);
- }
- return document;
- }
-
- /**
- * Return a partitioner for .java files.
- */
- private IDocumentPartitioner createJavaPartitioner() {
- return new DefaultPartitioner(getPHPPartitionScanner(), TYPES);
- }
-
- /**
- * Return a scanner for creating java partitions.
- */
- private PHPPartitionScanner getPHPPartitionScanner() {
- if (fgScanner == null)
- fgScanner= new PHPPartitionScanner();
- return fgScanner;
- }
+ public PHPDocumentProvider() {
+ super();
+ }
+
+ /* (non-Javadoc)
+ * Method declared on AbstractDocumentProvider
+ */
+ protected IDocument createDocument(Object element) throws CoreException {
+ IDocument document = super.createDocument(element);
+ if (document != null) {
+ IDocumentPartitioner partitioner = createPHPPartitioner();
+ document.setDocumentPartitioner(partitioner);
+ partitioner.connect(document);
+ }
+ return document;
+ }
+
+ /**
+ * Return a partitioner for .php files.
+ */
+ private IDocumentPartitioner createPHPPartitioner() {
+ return new DefaultPartitioner(getPHPPartitionScanner(), TYPES);
+ }
+
+ /**
+ * Return a scanner for creating java partitions.
+ */
+ private PHPPartitionScanner getPHPPartitionScanner() {
+ if (fgScanner == null)
+ fgScanner = new PHPPartitionScanner();
+ return fgScanner;
+ }
}