KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > debug > ui > snippeteditor > SnippetDocumentSetupParticipant


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - Initial implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.debug.ui.snippeteditor;
12
13 import org.eclipse.core.filebuffers.IDocumentSetupParticipant;
14 import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin;
15 import org.eclipse.jdt.ui.text.IJavaPartitions;
16 import org.eclipse.jdt.ui.text.JavaTextTools;
17 import org.eclipse.jface.text.IDocument;
18
19 /**
20  * The document setup participant for the Java Snippet Editor
21  */

22 public class SnippetDocumentSetupParticipant implements IDocumentSetupParticipant {
23
24     public SnippetDocumentSetupParticipant() {
25     }
26     
27     /*
28      * @see org.eclipse.core.filebuffers.IDocumentSetupParticipant#setup(org.eclipse.jface.text.IDocument)
29      */

30     public void setup(IDocument document) {
31         if (document != null) {
32             JavaTextTools tools= JDIDebugUIPlugin.getDefault().getJavaTextTools();
33             tools.setupJavaDocumentPartitioner(document, IJavaPartitions.JAVA_PARTITIONING);
34         }
35     }
36 }
37
Popular Tags