Merge branch 'master' of ssh://git.phpeclipse.com/phpeclipse
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / phpeditor / JavaStorageDocumentProvider.java
1 /**********************************************************************
2  Copyright (c) 2000, 2003 IBM Corp. 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  IBM Corporation - Initial implementation
10  **********************************************************************/
11 package net.sourceforge.phpeclipse.phpeditor;
12
13 import net.sourceforge.phpdt.internal.ui.text.IPHPPartitions;
14 import net.sourceforge.phpdt.ui.text.JavaTextTools;
15 import net.sourceforge.phpeclipse.PHPeclipsePlugin;
16
17 import org.eclipse.jface.text.IDocument;
18 import org.eclipse.ui.editors.text.StorageDocumentProvider;
19
20 /**
21  * @since 3.0
22  */
23 public class JavaStorageDocumentProvider extends StorageDocumentProvider {
24
25         public JavaStorageDocumentProvider() {
26                 super();
27         }
28
29         /*
30          * @see org.eclipse.ui.editors.text.StorageDocumentProvider#setupDocument(java.lang.Object,
31          *      org.eclipse.jface.text.IDocument)
32          */
33         protected void setupDocument(Object element, IDocument document) {
34
35                 if (document != null) {
36                         JavaTextTools tools = PHPeclipsePlugin.getDefault()
37                                         .getJavaTextTools();
38                         tools.setupJavaDocumentPartitioner(document,
39                                         IPHPPartitions.PHP_PARTITIONING);
40
41                         // tools.setupJavaDocumentPartitioner(document,
42                         // IDocument.DEFAULT_CONTENT_TYPE, element); //IPHPPartitions.HTML,
43                         // element);
44                 }
45         }
46 }