com.ibm.systemz.common.editor.extensionpoints.contentassist
Interface IContentAssistInvocationContext


public interface IContentAssistInvocationContext

Describes the context of an invocation of content assist in a text viewer. And provides methods useful in calculating content assist proposals.


Method Summary
 java.lang.Object getAst()
          Returns an AST representation of the source code.
 org.eclipse.jface.text.IDocument getDocument()
          Returns the document that content assist is invoked on, or null if not known.
 int getInvocationOffset()
          Returns the invocation offset.
 java.lang.String getTemplateContextId()
          Returns the template invocation context for this offset.
 java.util.List<SimpleCompletionProposal> getVariableCompletionProposals(int offset, java.lang.String prefix)
          Returns a list of simple proposals for the variables valid at the specified offset.
 org.eclipse.jface.text.ITextViewer getViewer()
          Returns the viewer, null if not available.
 

Method Detail

getInvocationOffset

int getInvocationOffset()
Returns the invocation offset.

Returns:
the invocation offset

getViewer

org.eclipse.jface.text.ITextViewer getViewer()
Returns the viewer, null if not available.

Returns:
the viewer, possibly null

getDocument

org.eclipse.jface.text.IDocument getDocument()
Returns the document that content assist is invoked on, or null if not known.

Returns:
the document or null

getTemplateContextId

java.lang.String getTemplateContextId()
Returns the template invocation context for this offset.

Returns:
one of the following values:
  • com.ibm.systemz.cobol.editor.template.context.cobol
  • com.ibm.systemz.cobol.editor.template.context.identification
  • com.ibm.systemz.cobol.editor.template.context.environment
  • com.ibm.systemz.cobol.editor.template.context.data
  • com.ibm.systemz.cobol.editor.template.context.procedure
  • com.ibm.systemz.cobol.editor.template.context.cics
  • com.ibm.systemz.cobol.editor.template.context.sql
  • com.ibm.systemz.cobol.editor.template.context.dli
  • com.ibm.systemz.pli.editor.template.context.pl1
  • com.ibm.systemz.pli.editor.template.context.cics
  • com.ibm.systemz.pli.editor.template.context.sql
  • com.ibm.systemz.pli.editor.template.context.dli
  • com.ibm.ftt.jcl.language.template.context.jcl

getAst

java.lang.Object getAst()
Returns an AST representation of the source code. Note this object is generated anew each invocation and may take a noticeable amount of time to generate. Will return null if an AST cannot be generated due to parse errors. This method returns null for PL/I and JCL programs.

Returns:
AST representation of the source code program, or null

getVariableCompletionProposals

java.util.List<SimpleCompletionProposal> getVariableCompletionProposals(int offset,
                                                                        java.lang.String prefix)
Returns a list of simple proposals for the variables valid at the specified offset. Variables will be filtered by comparing their variable name against the prefix, if supplied. Results can be further filtered by comparing their getType() results against the enumeration ECompletionProposalType

Parameters:
offset - the offset used to calculate the scope from which to pull the variable list.
prefix - A prefix used to filter the names of the variables
Returns:
A list of variable proposals