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
9 * Christopher Lenz - initial implementation
11 * $Id: XMLDocumentSetupParticipant.java,v 1.1 2004-09-02 18:28:04 jsurfer Exp $
14 package net.sourceforge.phpeclipse.xml.ui.internal.editor;
16 import org.eclipse.core.filebuffers.IDocumentSetupParticipant;
17 import org.eclipse.jface.text.IDocument;
18 import org.eclipse.jface.text.IDocumentPartitioner;
20 import net.sourceforge.phpeclipse.xml.ui.XMLPlugin;
21 import net.sourceforge.phpeclipse.xml.ui.text.XMLTextTools;
24 * Document setup participant that sets up the CSS specific partitioning.
26 public class XMLDocumentSetupParticipant implements IDocumentSetupParticipant {
29 * @see IDocumentSetupParticipant#setup(IDocument)
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);