KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ant > internal > ui > editor > templates > BuildFileContextType


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

11 package org.eclipse.ant.internal.ui.editor.templates;
12
13 import org.eclipse.jface.text.templates.TemplateContextType;
14 import org.eclipse.jface.text.templates.GlobalTemplateVariables;
15
16
17 /**
18  * A very simple context type.
19  */

20 public class BuildFileContextType extends TemplateContextType {
21
22     /** This context's id */
23     public static final String JavaDoc BUILDFILE_CONTEXT_TYPE= "org.eclipse.ant.ui.templateContextType.buildFile"; //$NON-NLS-1$
24

25     /**
26      * Creates a new XML context type.
27      */

28     public BuildFileContextType() {
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
Popular Tags