Eclipse Platform
Release 3.0

org.eclipse.ui.texteditor.templates
Class TemplateVariableProcessor

java.lang.Object
  extended byorg.eclipse.ui.texteditor.templates.TemplateVariableProcessor
All Implemented Interfaces:
IContentAssistProcessor

public class TemplateVariableProcessor
extends Object
implements IContentAssistProcessor

A content assist processor for template variables.

This class should not be used by clients and may become package visible in the future.

Since:
3.0

Constructor Summary
TemplateVariableProcessor()
           
 
Method Summary
 ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentOffset)
          Returns a list of completion proposals based on the specified location within the document that corresponds to the current cursor position within the text viewer.
 IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffset)
          Returns information about possible contexts based on the specified location within the document that corresponds to the current cursor position within the text viewer.
 char[] getCompletionProposalAutoActivationCharacters()
          Returns the characters which when entered by the user should automatically trigger the presentation of possible completions.
 char[] getContextInformationAutoActivationCharacters()
          Returns the characters which when entered by the user should automatically trigger the presentation of context information.
 IContextInformationValidator getContextInformationValidator()
          Returns a validator used to determine when displayed context information should be dismissed.
 TemplateContextType getContextType()
          Returns the context type.
 String getErrorMessage()
          Returns the reason why this content assist processor was unable to produce any completion proposals or context information.
 void setContextType(TemplateContextType contextType)
          Sets the context type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateVariableProcessor

public TemplateVariableProcessor()
Method Detail

setContextType

public void setContextType(TemplateContextType contextType)
Sets the context type.

Parameters:
contextType - the context type for this processor

getContextType

public TemplateContextType getContextType()
Returns the context type.

Returns:
the context type

computeCompletionProposals

public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer,
                                                        int documentOffset)
Description copied from interface: IContentAssistProcessor
Returns a list of completion proposals based on the specified location within the document that corresponds to the current cursor position within the text viewer.

Specified by:
computeCompletionProposals in interface IContentAssistProcessor
Parameters:
viewer - the viewer whose document is used to compute the proposals
documentOffset - an offset within the document for which completions should be computed
Returns:
an array of completion proposals or null if no proposals are possible

computeContextInformation

public IContextInformation[] computeContextInformation(ITextViewer viewer,
                                                       int documentOffset)
Description copied from interface: IContentAssistProcessor
Returns information about possible contexts based on the specified location within the document that corresponds to the current cursor position within the text viewer.

Specified by:
computeContextInformation in interface IContentAssistProcessor
Parameters:
viewer - the viewer whose document is used to compute the possible contexts
documentOffset - an offset within the document for which context information should be computed
Returns:
an array of context information objects or null if no context could be found

getCompletionProposalAutoActivationCharacters

public char[] getCompletionProposalAutoActivationCharacters()
Description copied from interface: IContentAssistProcessor
Returns the characters which when entered by the user should automatically trigger the presentation of possible completions.

Specified by:
getCompletionProposalAutoActivationCharacters in interface IContentAssistProcessor
Returns:
the auto activation characters for completion proposal or null if no auto activation is desired

getContextInformationAutoActivationCharacters

public char[] getContextInformationAutoActivationCharacters()
Description copied from interface: IContentAssistProcessor
Returns the characters which when entered by the user should automatically trigger the presentation of context information.

Specified by:
getContextInformationAutoActivationCharacters in interface IContentAssistProcessor
Returns:
the auto activation characters for presenting context information or null if no auto activation is desired

getErrorMessage

public String getErrorMessage()
Description copied from interface: IContentAssistProcessor
Returns the reason why this content assist processor was unable to produce any completion proposals or context information.

Specified by:
getErrorMessage in interface IContentAssistProcessor
Returns:
an error message or null if no error occurred

getContextInformationValidator

public IContextInformationValidator getContextInformationValidator()
Description copied from interface: IContentAssistProcessor
Returns a validator used to determine when displayed context information should be dismissed. May only return null if the processor is incapable of computing context information.

Specified by:
getContextInformationValidator in interface IContentAssistProcessor
Returns:
a context information validator, or null if the processor is incapable of computing context information

Eclipse Platform
Release 3.0

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.