Display strings returned from ICompletionItem.IFormatRange.getDisplayText()
may already be
formatted with left- and right-aligned columns by inserting tabs into
the strings. For some uses, that is sufficient.
For other uses, images and font styles are desired. For that, they
must implement ICompletionItem.IFormatRange.getDisplayFormatRanges()
, and return an array
of IFormatRange objects.
Each format range consists of a range and either a style or an icon (but not both).
Currently, the only style implemented is bold, for which one must returned the constant BOLD. getRange should return the range within the display text that is to be formatted.
When specifying an icon, the range can either be an empty point (start and end both equal the insertion offset), or it can be a range of the display text that is to be removed and replaced with the icon.
ICompletionItem
Field Summary |
public static final |
|
Method Summary |
public |
|
public |
|
public |
|
Field Detail |
public static final String
BOLD
Method Detail |
public Icon
getIcon()
Indicates an icon to be inserted into the display text at the
specified position.
Must return null if ICompletionItem.IFormatRange.getStyleName()
does not return null.
public Range
getRange()
Indicates the range affected by this format.
If the format is a font style, all of the display text in this range gets the applied formatting.
If the format is an icon, the range is usually just an offset (no length) where the icon should be inserted. If the range has a length, then those characters of the display text are removed, and replace with the icon.
public String
getStyleName()
Indicates how the display text in the specified range are to be
formatted. Currently, only BOLD formatting is implemented.
Must return null if ICompletionItem.IFormatRange.getIcon()
does not return null.