*** empty log message ***
[phpeclipse.git] / net.sourceforge.phpeclipse.xml.ui / src / net / sourceforge / phpeclipse / xml / ui / internal / editor / XMLDocumentSetupParticipant.java
1 /*
2  * Copyright (c) 2004 Christopher Lenz 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
7  * 
8  * Contributors:
9  *     Christopher Lenz - initial implementation
10  * 
11  * $Id: XMLDocumentSetupParticipant.java,v 1.1 2004-09-02 18:28:04 jsurfer Exp $
12  */
13
14 package net.sourceforge.phpeclipse.xml.ui.internal.editor;
15
16 import org.eclipse.core.filebuffers.IDocumentSetupParticipant;
17 import org.eclipse.jface.text.IDocument;
18 import org.eclipse.jface.text.IDocumentPartitioner;
19
20 import net.sourceforge.phpeclipse.xml.ui.XMLPlugin;
21 import net.sourceforge.phpeclipse.xml.ui.text.XMLTextTools;
22
23 /**
24  * Document setup participant that sets up the CSS specific partitioning.
25  */
26 public class XMLDocumentSetupParticipant implements IDocumentSetupParticipant {
27
28         /* 
29          * @see IDocumentSetupParticipant#setup(IDocument)
30          */
31         public void setup(IDocument document) {
32                 if (document != null) {
33                         XMLTextTools tools = XMLPlugin.getDefault().getXMLTextTools();
34                         IDocumentPartitioner partitioner = tools.createXMLPartitioner();
35                         partitioner.connect(document);
36                         document.setDocumentPartitioner(partitioner);
37                 }
38         }
39
40 }