Class ContextInformation
- java.lang.Object
-
- org.eclipse.jface.text.contentassist.ContextInformation
-
- All Implemented Interfaces:
IContextInformation
public final class ContextInformation extends Object implements IContextInformation
A default implementation of theIContextInformationinterface.
-
-
Constructor Summary
Constructors Constructor Description ContextInformation(String contextDisplayString, String informationDisplayString)Creates a new context information without an image.ContextInformation(Image image, String contextDisplayString, String informationDisplayString)Creates a new context information with an image.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object object)Compares the given object with this receiver.StringgetContextDisplayString()Returns the string to be displayed in the list of contexts.ImagegetImage()Returns the image for this context information.StringgetInformationDisplayString()Returns the string to be displayed in the tool tip like information popup.inthashCode()
-
-
-
Constructor Detail
-
ContextInformation
public ContextInformation(String contextDisplayString, String informationDisplayString)
Creates a new context information without an image.- Parameters:
contextDisplayString- the string to be used when presenting the contextinformationDisplayString- the string to be displayed when presenting the context information
-
ContextInformation
public ContextInformation(Image image, String contextDisplayString, String informationDisplayString)
Creates a new context information with an image.- Parameters:
image- the image to display when presenting the context informationcontextDisplayString- the string to be used when presenting the contextinformationDisplayString- the string to be displayed when presenting the context information, may not benull
-
-
Method Detail
-
equals
public boolean equals(Object object)
Description copied from interface:IContextInformationCompares the given object with this receiver. Two context informations are equal if there information display strings and their context display strings are equal.Note: As specified in
Object.equals(Object)clients will most likely also have to implementObject.hashCode().- Specified by:
equalsin interfaceIContextInformation- Overrides:
equalsin classObject- See Also:
Object.equals(Object)
-
getInformationDisplayString
public String getInformationDisplayString()
Description copied from interface:IContextInformationReturns the string to be displayed in the tool tip like information popup.- Specified by:
getInformationDisplayStringin interfaceIContextInformation- Returns:
- the string to be displayed
-
getImage
public Image getImage()
Description copied from interface:IContextInformationReturns the image for this context information. The image will be shown to the left of the display string.- Specified by:
getImagein interfaceIContextInformation- Returns:
- the image to be shown or
nullif no image is desired
-
getContextDisplayString
public String getContextDisplayString()
Description copied from interface:IContextInformationReturns the string to be displayed in the list of contexts. This method is used to supply a unique presentation for situations where the context is ambiguous. These strings are used to allow the user to select the specific context.- Specified by:
getContextDisplayStringin interfaceIContextInformation- Returns:
- the string to be displayed for the context
-
-