1aef9255ab003dbc63d920a1419da742b953b2d7
[phpeclipse.git] / net.sourceforge.phpeclipse.smarty.ui / src / net / sourceforge / phpdt / smarty / ui / internal / text / SmartyCompletionProcessor.java
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 net.sourceforge.phpdt.smarty.ui.internal.text;
12
13 import net.sourceforge.phpeclipse.ui.WebUI;
14 import net.sourceforge.phpeclipse.ui.templates.template.BasicCompletionProcessor;
15 import net.sourceforge.phpeclipse.ui.templates.template.HTMLContextType;
16
17 import org.eclipse.jface.text.IRegion;
18 import org.eclipse.jface.text.ITextViewer;
19 import org.eclipse.jface.text.templates.TemplateContextType;
20
21 /**
22  * A completion processor for XML templates.
23  */
24 public class SmartyCompletionProcessor extends BasicCompletionProcessor {
25
26         /**
27          * Return the XML context type that is supported by this plugin.
28          */
29         protected TemplateContextType getContextType(ITextViewer viewer,
30                         IRegion region) {
31                 return WebUI.getDefault().getContextTypeRegistry().getContextType(
32                                 HTMLContextType.HTML_CONTEXT_TYPE);
33         }
34
35 }