org.eclipse.xtext.ui.editor.contentassist
Class SmartInformationAwareContextInformationValidator

java.lang.Object
  extended by org.eclipse.xtext.ui.editor.contentassist.SmartInformationAwareContextInformationValidator
All Implemented Interfaces:
org.eclipse.jface.text.contentassist.IContextInformationPresenter, org.eclipse.jface.text.contentassist.IContextInformationValidator

public class SmartInformationAwareContextInformationValidator
extends java.lang.Object
implements org.eclipse.jface.text.contentassist.IContextInformationValidator, org.eclipse.jface.text.contentassist.IContextInformationPresenter

An implementation of the IContextInfomationValidator interface. This implementation tries to use ISmartContextInformation to determine the validity of the information. If this interface is not fulfilled, it 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.

Since:
2.3
See Also:
ContextInformationValidator

Constructor Summary
SmartInformationAwareContextInformationValidator(org.eclipse.jface.text.contentassist.IContentAssistProcessor processor)
          Creates a new context information validator which is ready to be installed on a particular context information.
 
Method Summary
 void install(org.eclipse.jface.text.contentassist.IContextInformation contextInformation, org.eclipse.jface.text.ITextViewer viewer, int offset)
           
 boolean isContextInformationValid(int offset)
           
 boolean updatePresentation(int offset, org.eclipse.jface.text.TextPresentation presentation)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SmartInformationAwareContextInformationValidator

public SmartInformationAwareContextInformationValidator(org.eclipse.jface.text.contentassist.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(org.eclipse.jface.text.contentassist.IContextInformation contextInformation,
                    org.eclipse.jface.text.ITextViewer viewer,
                    int offset)
Specified by:
install in interface org.eclipse.jface.text.contentassist.IContextInformationPresenter
Specified by:
install in interface org.eclipse.jface.text.contentassist.IContextInformationValidator

isContextInformationValid

public boolean isContextInformationValid(int offset)
Specified by:
isContextInformationValid in interface org.eclipse.jface.text.contentassist.IContextInformationValidator

updatePresentation

public boolean updatePresentation(int offset,
                                  org.eclipse.jface.text.TextPresentation presentation)
Specified by:
updatePresentation in interface org.eclipse.jface.text.contentassist.IContextInformationPresenter