intial source from http://www.sf.net/projects/wdte
[phpeclipse.git] / net.sourceforge.phpeclipse.ui / src / net / sourceforge / phpeclipse / ui / templates / template / JSContextType.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.phpeclipse.ui.templates.template;
12
13 import org.eclipse.jface.text.templates.GlobalTemplateVariables;
14 import org.eclipse.jface.text.templates.TemplateContextType;
15
16
17 /**
18  * A very simple context type.
19  */
20 public class JSContextType extends TemplateContextType {
21
22         /** This context's id */
23         public static final String JS_CONTEXT_TYPE= "javascript"; //$NON-NLS-1$
24
25         /**
26          * Creates a new XML context type. 
27          */
28         public JSContextType() {
29                 addGlobalResolvers();
30         }
31
32         private void addGlobalResolvers() {
33                 addResolver(new GlobalTemplateVariables.Cursor());
34                 addResolver(new GlobalTemplateVariables.WordSelection());
35                 addResolver(new GlobalTemplateVariables.LineSelection());
36                 addResolver(new GlobalTemplateVariables.Dollar());
37                 addResolver(new GlobalTemplateVariables.Date());
38                 addResolver(new GlobalTemplateVariables.Year());
39                 addResolver(new GlobalTemplateVariables.Time());
40                 addResolver(new GlobalTemplateVariables.User());
41         }
42
43 }