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

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
Direct Known Subclasses:
CContext, CommentContext

public abstract class TranslationUnitContext
extends org.eclipse.jface.text.templates.DocumentTemplateContext

A translation unit context.


Method Summary
 boolean canEvaluate(org.eclipse.jface.text.templates.Template template)
           
 org.eclipse.cdt.core.model.ICElement findEnclosingElement(int elementType)
          Returns the enclosing element of a particular element type, null if no enclosing element of that type exists.
 java.lang.String getKey()
           
 org.eclipse.cdt.core.model.ITranslationUnit getTranslationUnit()
          Returns the translation unit if one is associated with this context, null otherwise.
 void setForceEvaluation(boolean evaluate)
          Sets whether evaluation is forced or not.
 
Methods inherited from class org.eclipse.jface.text.templates.DocumentTemplateContext
evaluate, getCompletionLength, getCompletionOffset, getDocument, getEnd, getStart
 
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
 

Method Detail

canEvaluate

public boolean canEvaluate(org.eclipse.jface.text.templates.Template template)
Overrides:
canEvaluate in class org.eclipse.jface.text.templates.DocumentTemplateContext

getKey

public java.lang.String getKey()
Overrides:
getKey in class org.eclipse.jface.text.templates.DocumentTemplateContext

getTranslationUnit

public final org.eclipse.cdt.core.model.ITranslationUnit getTranslationUnit()
Returns the translation unit if one is associated with this context, null otherwise.


findEnclosingElement

public org.eclipse.cdt.core.model.ICElement findEnclosingElement(int elementType)
Returns the enclosing element of a particular element type, null if no enclosing element of that type exists.


setForceEvaluation

public void setForceEvaluation(boolean evaluate)
Sets whether evaluation is forced or not.

Parameters:
evaluate - true in order to force evaluation, false otherwise