Class ContextInformationValidator
- java.lang.Object
-
- org.eclipse.jface.text.contentassist.ContextInformationValidator
-
- All Implemented Interfaces:
IContextInformationValidator
public final class ContextInformationValidator extends Object implements IContextInformationValidator
A default implementation of theIContextInfomationValidator
interface. This implementation determines whether the information is valid by asking the content assist processor for all context information objects for the current position. If the currently displayed information is in the result set, the context information is considered valid.
-
-
Constructor Summary
Constructors Constructor Description ContextInformationValidator(IContentAssistProcessor processor)
Creates a new context information validator which is ready to be installed on a particular context information.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
install(IContextInformation contextInformation, ITextViewer viewer, int offset)
Installs this validator for the given context information.boolean
isContextInformationValid(int offset)
Returns whether the information this validator is installed on is still valid at the given document position.
-
-
-
Constructor Detail
-
ContextInformationValidator
public ContextInformationValidator(IContentAssistProcessor processor)
Creates a new context information validator which is ready to be installed on a particular context information.- Parameters:
processor
- the processor to be used for validation
-
-
Method Detail
-
install
public void install(IContextInformation contextInformation, ITextViewer viewer, int offset)
Description copied from interface:IContextInformationValidator
Installs this validator for the given context information.- Specified by:
install
in interfaceIContextInformationValidator
- Parameters:
contextInformation
- the context information which this validator should checkviewer
- the text viewer on which the information is presentedoffset
- the document offset for which the information has been computed
-
isContextInformationValid
public boolean isContextInformationValid(int offset)
Description copied from interface:IContextInformationValidator
Returns whether the information this validator is installed on is still valid at the given document position.- Specified by:
isContextInformationValid
in interfaceIContextInformationValidator
- Parameters:
offset
- the current offset within the document- Returns:
true
if the information also valid at the given document position
-
-