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.3 2006-10-21 23:14:14 pombredanne Exp $
14 package net.sourceforge.phpeclipse.xml.ui.internal.editor;
16 import net.sourceforge.phpeclipse.xml.ui.XMLPlugin;
17 import net.sourceforge.phpeclipse.xml.ui.text.XMLTextTools;
19 import org.eclipse.core.filebuffers.IDocumentSetupParticipant;
20 import org.eclipse.jface.text.IDocument;
21 import org.eclipse.jface.text.IDocumentPartitioner;
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);