org.eclipse.cdt.internal.corext.template.c
Class CContext
java.lang.Object
org.eclipse.jface.text.templates.TemplateContext
org.eclipse.jface.text.templates.DocumentTemplateContext
org.eclipse.cdt.internal.corext.template.c.TranslationUnitContext
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.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 |
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 typedocument
- the documentcompletionOffset
- the completion position within the documentcompletionLength
- the length of the contexttranslationUnit
- 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 documenttranslationUnit
- the translation unit (may be null
).
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