KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > javaeditor > JavaStorageDocumentProvider


1 /*******************************************************************************
2  * Copyright (c) 2000, 2004 IBM Corporation 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 API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.ui.javaeditor;
12
13 import org.eclipse.jface.text.IDocument;
14
15 import org.eclipse.ui.editors.text.StorageDocumentProvider;
16
17 import org.eclipse.jdt.ui.text.JavaTextTools;
18
19 import org.eclipse.jdt.internal.ui.JavaPlugin;
20 import org.eclipse.jdt.internal.ui.text.IJavaPartitions;
21
22 /**
23  * @since 3.0
24  */

25 public class JavaStorageDocumentProvider extends StorageDocumentProvider {
26     
27     public JavaStorageDocumentProvider() {
28         super();
29     }
30     
31     /*
32      * @see org.eclipse.ui.editors.text.StorageDocumentProvider#setupDocument(java.lang.Object, org.eclipse.jface.text.IDocument)
33      */

34     protected void setupDocument(Object JavaDoc element, IDocument document) {
35         if (document != null) {
36             JavaTextTools tools= JavaPlugin.getDefault().getJavaTextTools();
37             tools.setupJavaDocumentPartitioner(document, IJavaPartitions.JAVA_PARTITIONING);
38         }
39     }
40 }
41
Popular Tags