org.eclipse.cdt.internal.ui.text.contentassist
Class CContentAssistInvocationContext

java.lang.Object
  extended by org.eclipse.cdt.ui.text.contentassist.ContentAssistInvocationContext
      extended by org.eclipse.cdt.internal.ui.text.contentassist.CContentAssistInvocationContext

public class CContentAssistInvocationContext
extends ContentAssistInvocationContext

Describes the context of a content assist invocation in a C/C++ editor.

Clients may use but not subclass this class.

Since:
4.0

Constructor Summary
CContentAssistInvocationContext(org.eclipse.jface.text.ITextViewer viewer, int offset, org.eclipse.ui.IEditorPart editor, boolean isCompletion)
          Creates a new context.
CContentAssistInvocationContext(org.eclipse.cdt.core.model.ITranslationUnit unit, boolean isCompletion)
          Creates a new context.
 
Method Summary
 void dispose()
          Called upon completion of the content assist.
 org.eclipse.cdt.core.dom.ast.IASTCompletionNode getCompletionNode()
           
 int getContextInformationOffset()
           
 org.eclipse.ui.IEditorPart getEditor()
          Get the editor content assist is invoked in.
 int getParseOffset()
           
 org.eclipse.cdt.core.model.ICProject getProject()
          Returns the project of the translation unit that content assist is invoked in, null if none.
 org.eclipse.cdt.core.model.ITranslationUnit getTranslationUnit()
          Returns the translation unit that content assist is invoked in, null if there is none.
 boolean isContextInformationStyle()
           
 
Methods inherited from class org.eclipse.cdt.ui.text.contentassist.ContentAssistInvocationContext
computeIdentifierPrefix, equals, getDocument, getInvocationOffset, getViewer, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CContentAssistInvocationContext

public CContentAssistInvocationContext(org.eclipse.jface.text.ITextViewer viewer,
                                       int offset,
                                       org.eclipse.ui.IEditorPart editor,
                                       boolean isCompletion)
Creates a new context.

Parameters:
viewer - the viewer used by the editor
offset - the invocation offset
editor - the editor that content assist is invoked in

CContentAssistInvocationContext

public CContentAssistInvocationContext(org.eclipse.cdt.core.model.ITranslationUnit unit,
                                       boolean isCompletion)
Creates a new context.

Parameters:
unit - the translation unit in document
Method Detail

getTranslationUnit

public org.eclipse.cdt.core.model.ITranslationUnit getTranslationUnit()
Returns the translation unit that content assist is invoked in, null if there is none.

Returns:
the translation unit that content assist is invoked in, possibly null

getProject

public org.eclipse.cdt.core.model.ICProject getProject()
Returns the project of the translation unit that content assist is invoked in, null if none.

Returns:
the current C project, possibly null

getCompletionNode

public org.eclipse.cdt.core.dom.ast.IASTCompletionNode getCompletionNode()

getParseOffset

public int getParseOffset()

getContextInformationOffset

public int getContextInformationOffset()
Returns:
the offset where context information (parameter hints) starts.

getEditor

public org.eclipse.ui.IEditorPart getEditor()
Get the editor content assist is invoked in.

Returns:
the editor, may be null

isContextInformationStyle

public boolean isContextInformationStyle()

dispose

public void dispose()
Description copied from class: ContentAssistInvocationContext
Called upon completion of the content assist. Used to free any resources used by the context.

Overrides:
dispose in class ContentAssistInvocationContext