ICompletionItem.IFormatRange Interface

com.bea.ide.sourceeditor.compiler
ICompletionItem.IFormatRange Interface

public static interface ICompletionItem.IFormatRange

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.

Enclosing interface

ICompletionItem

Field Summary

public static final String
BOLD
The only implemented font style.
 

Method Summary

public Icon
getIcon()
Indicates an icon to be inserted into the display text at the specified position.
public Range
getRange()
Indicates the range affected by this format.
public String
getStyleName()
Indicates how the display text in the specified range are to be formatted.

Field Detail

BOLD

public static final String BOLD
The only implemented font style. Causes ranges with this format to use a bold font.

 

Method Detail

getIcon() Method

public Icon getIcon()
Indicates an icon to be inserted into the display text at the specified position.

Returns

a valid Icon object.

Must return null if ICompletionItem.IFormatRange.getStyleName() does not return null.


getRange() Method

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.


getStyleName() Method

public String getStyleName()
Indicates how the display text in the specified range are to be formatted. Currently, only BOLD formatting is implemented.

Returns

BOLD to make the given range bold.

Must return null if ICompletionItem.IFormatRange.getIcon() does not return null.