1 package net.sourceforge.phpeclipse.editors;
3 import org.eclipse.core.runtime.CoreException;
4 import org.eclipse.jface.text.IDocument;
5 import org.eclipse.jface.text.IDocumentPartitioner;
6 import org.eclipse.jface.text.rules.DefaultPartitioner;
7 import org.eclipse.ui.editors.text.FileDocumentProvider;
9 public class PHPDocumentProvider extends FileDocumentProvider {
12 * Constructor for XMLDocumentProvider.
14 public PHPDocumentProvider() {
19 * Method declared on AbstractDocumentProvider
21 protected IDocument createDocument(Object element) throws CoreException {
22 IDocument document = super.createDocument(element);
23 if (document != null) {
24 IDocumentPartitioner partitioner =
25 new DefaultPartitioner(
26 new PHPPartitionScanner(),
28 PHPPartitionScanner.HTML_TAG,
29 PHPPartitionScanner.HTML_COMMENT });
30 partitioner.connect(document);
31 document.setDocumentPartitioner(partitioner);