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 net.sourceforge.phpdt.core.ICompilationUnit;
15 import org.eclipse.jface.text.IDocument;
16 import org.eclipse.jface.text.templates.GlobalTemplateVariables;
19 * A context type for javadoc.
21 public class JavaDocContextType extends CompilationUnitContextType {
23 public static final String NAME = "phpdoc"; //$NON-NLS-1$
26 * Creates a java context type.
28 public JavaDocContextType() {
32 addResolver(new GlobalTemplateVariables.Cursor());
33 addResolver(new GlobalTemplateVariables.LineSelection());
34 addResolver(new GlobalTemplateVariables.WordSelection());
35 addResolver(new GlobalTemplateVariables.Dollar());
36 addResolver(new GlobalTemplateVariables.Date());
37 addResolver(new GlobalTemplateVariables.Year());
38 addResolver(new GlobalTemplateVariables.Time());
39 addResolver(new GlobalTemplateVariables.User());
42 addResolver(new File());
43 addResolver(new PrimaryTypeName());
44 addResolver(new Method());
45 addResolver(new ReturnType());
46 addResolver(new Arguments());
47 addResolver(new Type());
48 addResolver(new Package());
49 addResolver(new Project());
55 * @see net.sourceforge.phpdt.internal.corext.template.java.CompilationUnitContextType#createContext(org.eclipse.jface.text.IDocument,
56 * int, int, net.sourceforge.phpdt.core.ICompilationUnit)
58 public CompilationUnitContext createContext(IDocument document, int offset,
59 int length, ICompilationUnit compilationUnit) {
60 return new JavaDocContext(this, document, offset, length,