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

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.CommentContext

public class CommentContext
extends TranslationUnitContext

A context for (block) comments.

Since:
4.0

Constructor Summary
CommentContext(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 comment template context.
CommentContext(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 comment 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

CommentContext

public CommentContext(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 comment template context.

Parameters:
type - the context type.
document - the document.
completionOffset - the completion offset within the document.
completionLength - the completion length within the document.
translationUnit - the translation unit (may be null).

CommentContext

public CommentContext(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 comment 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