~piastucki/bzr-eclipse/history-view-enhancements

« back to all changes in this revision

Viewing changes to org.vcs.bazaar.eclipse.ui/src/org/vcs/bazaar/eclipse/ui/editors/XMLDocumentProvider.java

  • Committer: Guillermo Gonzalez
  • Date: 2007-03-14 12:15:50 UTC
  • Revision ID: guillo.gonzo@gmail.com-20070314121550-tltk3b6f3zblf0dh
Initial commit with the new code layout.
Now starts the real work

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.vcs.bazaar.eclipse.ui.editors;
 
2
 
 
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.FastPartitioner;
 
7
import org.eclipse.ui.editors.text.FileDocumentProvider;
 
8
 
 
9
public class XMLDocumentProvider extends FileDocumentProvider {
 
10
 
 
11
        protected IDocument createDocument(Object element) throws CoreException {
 
12
                IDocument document = super.createDocument(element);
 
13
                if (document != null) {
 
14
                        IDocumentPartitioner partitioner =
 
15
                                new FastPartitioner(
 
16
                                        new XMLPartitionScanner(),
 
17
                                        new String[] {
 
18
                                                XMLPartitionScanner.XML_TAG,
 
19
                                                XMLPartitionScanner.XML_COMMENT });
 
20
                        partitioner.connect(document);
 
21
                        document.setDocumentPartitioner(partitioner);
 
22
                }
 
23
                return document;
 
24
        }
 
25
}
 
 
b'\\ No newline at end of file'