org.eclipse.cdt.internal.corext.template.c
Class CContext

java.lang.Object
  extended by org.eclipse.jface.text.templates.TemplateContext
      extended by org.eclipse.jface.text.templates.DocumentTemplateContext
          extended by org.eclipse.cdt.internal.corext.template.c.TranslationUnitContext
              extended by org.eclipse.cdt.internal.corext.template.c.CContext

public class CContext
extends TranslationUnitContext

A context for C/C++


Constructor Summary
CContext(org.eclipse.jface.text.templates.TemplateContextType type, org.eclipse.jface.text.IDocument document, int completionOffset, int completionLength, org.eclipse.cdt.core.model.ITranslationUnit translationUnit)
          Creates a C/C++ code template context.
CContext(org.eclipse.jface.text.templates.TemplateContextType type, org.eclipse.jface.text.IDocument document, org.eclipse.jface.text.Position completionPosition, org.eclipse.cdt.core.model.ITranslationUnit translationUnit)
          Creates a C/C++ code template context.
 
Method Summary
 org.eclipse.jface.text.templates.TemplateBuffer evaluate(org.eclipse.jface.text.templates.Template template)
           
 int getEnd()
           
 int getStart()
           
 
Methods inherited from class org.eclipse.cdt.internal.corext.template.c.TranslationUnitContext
canEvaluate, findEnclosingElement, getKey, getTranslationUnit, setForceEvaluation
 
Methods inherited from class org.eclipse.jface.text.templates.DocumentTemplateContext
getCompletionLength, getCompletionOffset, getDocument
 
Methods inherited from class org.eclipse.jface.text.templates.TemplateContext
getContextType, getVariable, isReadOnly, setReadOnly, setVariable
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CContext

public CContext(org.eclipse.jface.text.templates.TemplateContextType type,
                org.eclipse.jface.text.IDocument document,
                int completionOffset,
                int completionLength,
                org.eclipse.cdt.core.model.ITranslationUnit translationUnit)
Creates a C/C++ code template context.

Parameters:
type - the context type
document - the document
completionOffset - the completion position within the document
completionLength - the length of the context
translationUnit - the translation unit represented by the document

CContext

public CContext(org.eclipse.jface.text.templates.TemplateContextType type,
                org.eclipse.jface.text.IDocument document,
                org.eclipse.jface.text.Position completionPosition,
                org.eclipse.cdt.core.model.ITranslationUnit translationUnit)
Creates a C/C++ code template context.

Parameters:
type - the context type.
document - the document.
completionPosition - the completion position within the document
translationUnit - the translation unit (may be null).
Method Detail

getStart

public int getStart()
Overrides:
getStart in class org.eclipse.jface.text.templates.DocumentTemplateContext

getEnd

public int getEnd()
Overrides:
getEnd in class org.eclipse.jface.text.templates.DocumentTemplateContext

evaluate

public org.eclipse.jface.text.templates.TemplateBuffer evaluate(org.eclipse.jface.text.templates.Template template)
                                                         throws org.eclipse.jface.text.BadLocationException,
                                                                org.eclipse.jface.text.templates.TemplateException
Overrides:
evaluate in class org.eclipse.jface.text.templates.DocumentTemplateContext
Throws:
org.eclipse.jface.text.BadLocationException
org.eclipse.jface.text.templates.TemplateException