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
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package net.sourceforge.phpdt.internal.corext.template.php;
13 import org.eclipse.jface.text.IDocument;
14 import org.eclipse.jface.text.templates.*;
16 import net.sourceforge.phpdt.core.ICompilationUnit;
20 * A context type for javadoc.
22 public class JavaDocContextType extends CompilationUnitContextType {
24 public static final String NAME= "phpdoc"; //$NON-NLS-1$
27 * Creates a java context type.
29 public JavaDocContextType() {
33 addResolver(new GlobalTemplateVariables.Cursor());
34 addResolver(new GlobalTemplateVariables.LineSelection());
35 addResolver(new GlobalTemplateVariables.WordSelection());
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());
43 addResolver(new File());
44 addResolver(new PrimaryTypeName());
45 addResolver(new Method());
46 addResolver(new ReturnType());
47 addResolver(new Arguments());
48 addResolver(new Type());
49 addResolver(new Package());
50 addResolver(new Project());
54 * @see org.eclipse.jdt.internal.corext.template.java.CompilationUnitContextType#createContext(org.eclipse.jface.text.IDocument, int, int, org.eclipse.jdt.core.ICompilationUnit)
56 public CompilationUnitContext createContext(IDocument document, int offset, int length, ICompilationUnit compilationUnit) {
57 return new JavaDocContext(this, document, offset, length, compilationUnit);