2 * Copyright (c) 2002-2004 Widespace, OU and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * Igor Malinin - initial contribution
11 * $Id: DTDDocumentProvider.java,v 1.1 2004-09-02 18:28:03 jsurfer Exp $
14 package net.sourceforge.phpeclipse.xml.ui.internal.text;
16 import org.eclipse.core.runtime.CoreException;
17 import org.eclipse.jface.text.IDocument;
18 import org.eclipse.jface.text.IDocumentPartitioner;
20 import net.sourceforge.phpeclipse.xml.ui.XMLPlugin;
24 * DTD document provider.
26 * @author Igor Malinin
28 public class DTDDocumentProvider extends AbstractDocumentProvider {
30 * @see org.eclipse.ui.texteditor.AbstractDocumentProvider#createDocument(Object)
32 protected IDocument createDocument( Object element ) throws CoreException {
33 IDocument document = super.createDocument( element );
34 if ( document != null ) {
35 IDocumentPartitioner partitioner = XMLPlugin
36 .getDefault().getDTDTextTools().createDTDPartitioner();
38 if ( partitioner != null ) {
39 partitioner.connect( document );
40 document.setDocumentPartitioner( partitioner );