org.eclipse.xtext.xbase.ui.contentassist
Class ParameterContextInformation

java.lang.Object
  extended by org.eclipse.xtext.xbase.ui.contentassist.ParameterContextInformation
All Implemented Interfaces:
org.eclipse.jface.text.contentassist.IContextInformation, org.eclipse.jface.text.contentassist.IContextInformationExtension, ISmartContextInformation

public class ParameterContextInformation
extends java.lang.Object
implements ISmartContextInformation

This class is mainly adopted from ProposalContextInformation and friends.

Author:
Sebastian Zarnekow - Initial contribution and API
See Also:
JavaParameterListValidator
This class is not intended to be subclassed by clients.
This class is not intended to be subclassed by clients.
This class is not intended to be instantiated by clients.
This class is not intended to be instantiated by clients.

Constructor Summary
ParameterContextInformation(ParameterData data, java.lang.String contextDisplayString, int position)
           
 
Method Summary
protected  int advance(java.lang.String code, int length, int pos, char left, char right)
           
protected  boolean checkGenericsHeuristic(org.eclipse.jface.text.IDocument document, int end, int bound)
           
protected  int[] computeCommaPositions(java.lang.String code)
           
 boolean equals(java.lang.Object object)
           
protected  int getCharCount(org.eclipse.jface.text.IDocument document, int start, int end, java.lang.String increments, java.lang.String decrements, boolean considerNesting)
           
protected  int getCommentEnd(org.eclipse.jface.text.IDocument d, int pos, int end)
           
 java.lang.String getContextDisplayString()
           
 int getContextInformationPosition()
           
 org.eclipse.swt.graphics.Image getImage()
           
 java.lang.String getInformationDisplayString()
           
protected  int getStringEnd(org.eclipse.jface.text.IDocument d, int pos, int end, char ch)
           
 int hashCode()
           
 java.util.List<java.lang.String> internalGetInformationDisplayString()
           
 boolean isContextInformationValid(org.eclipse.jface.text.ITextViewer viewer, int position)
           
 boolean updatePresentation(org.eclipse.jface.text.ITextViewer viewer, int position, org.eclipse.jface.text.TextPresentation presentation)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParameterContextInformation

public ParameterContextInformation(ParameterData data,
                                   java.lang.String contextDisplayString,
                                   int position)
Method Detail

equals

public boolean equals(java.lang.Object object)
Specified by:
equals in interface org.eclipse.jface.text.contentassist.IContextInformation
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getInformationDisplayString

public java.lang.String getInformationDisplayString()
Specified by:
getInformationDisplayString in interface org.eclipse.jface.text.contentassist.IContextInformation

internalGetInformationDisplayString

public java.util.List<java.lang.String> internalGetInformationDisplayString()

getImage

public org.eclipse.swt.graphics.Image getImage()
Specified by:
getImage in interface org.eclipse.jface.text.contentassist.IContextInformation

getContextDisplayString

public java.lang.String getContextDisplayString()
Specified by:
getContextDisplayString in interface org.eclipse.jface.text.contentassist.IContextInformation

getContextInformationPosition

public int getContextInformationPosition()
Specified by:
getContextInformationPosition in interface org.eclipse.jface.text.contentassist.IContextInformationExtension

isContextInformationValid

public boolean isContextInformationValid(org.eclipse.jface.text.ITextViewer viewer,
                                         int position)
Specified by:
isContextInformationValid in interface ISmartContextInformation
See Also:
IContextInformationValidator.isContextInformationValid(int)

updatePresentation

public boolean updatePresentation(org.eclipse.jface.text.ITextViewer viewer,
                                  int position,
                                  org.eclipse.jface.text.TextPresentation presentation)
Specified by:
updatePresentation in interface ISmartContextInformation
See Also:
IContextInformationPresenter.updatePresentation(int, TextPresentation)

computeCommaPositions

protected int[] computeCommaPositions(java.lang.String code)

advance

protected int advance(java.lang.String code,
                      int length,
                      int pos,
                      char left,
                      char right)

getCharCount

protected int getCharCount(org.eclipse.jface.text.IDocument document,
                           int start,
                           int end,
                           java.lang.String increments,
                           java.lang.String decrements,
                           boolean considerNesting)
                    throws org.eclipse.jface.text.BadLocationException
Throws:
org.eclipse.jface.text.BadLocationException

getCommentEnd

protected int getCommentEnd(org.eclipse.jface.text.IDocument d,
                            int pos,
                            int end)
                     throws org.eclipse.jface.text.BadLocationException
Throws:
org.eclipse.jface.text.BadLocationException

getStringEnd

protected int getStringEnd(org.eclipse.jface.text.IDocument d,
                           int pos,
                           int end,
                           char ch)
                    throws org.eclipse.jface.text.BadLocationException
Throws:
org.eclipse.jface.text.BadLocationException

checkGenericsHeuristic

protected boolean checkGenericsHeuristic(org.eclipse.jface.text.IDocument document,
                                         int end,
                                         int bound)