public interface Inlay<T extends EditorCustomElementRenderer> extends Disposable, UserDataHolderEx
RangeMarker
. Both 'inline' (displayed within text lines) and 'block' (displayed between text lines) elements are supported.
Inlay becomes invalid on explicit disposal, or when a document range fully containing inlay's offset, is deleted.
InlayModel
Modifier and Type | Interface and Description |
---|---|
static class |
Inlay.Placement |
Disposable.Parent
Modifier and Type | Method and Description |
---|---|
java.awt.Rectangle |
getBounds()
Returns inlay element's bounds in editor coordinate system if it's visible (not folded), or
null otherwise |
Editor |
getEditor()
Returns editor, this custom visual element belongs to.
|
GutterIconRenderer |
getGutterIconRenderer()
Returns
GutterIconRenderer instance defining an icon displayed in gutter, and associated actions (supported for block inlays
at the moment). |
int |
getHeightInPixels()
Returns current inlay's width.
|
int |
getOffset()
Returns current inlay's position in the document.
|
Inlay.Placement |
getPlacement()
Defines relative position of inlay element with respect to the containing text.
|
T |
getRenderer()
Returns renderer, which defines size and representation for this inlay.
|
VisualPosition |
getVisualPosition()
Returns current visual position of the inlay's left boundary.
|
int |
getWidthInPixels()
Returns current inlay's width.
|
boolean |
isRelatedToPrecedingText()
Tells whether this element is associated with preceding or following text.
|
boolean |
isValid()
Tells whether this element is valid.
|
void |
repaint()
Causes repaint of inlay in editor.
|
void |
update()
Updates inlay properties (width, height, gutter icon renderer) from inlay's renderer.
|
default void |
updateSize()
Deprecated.
Use
update() instead. |
dispose
putUserDataIfAbsent, replace
getUserData, putUserData
Editor getEditor()
Inlay.Placement getPlacement()
boolean isValid()
int getOffset()
RangeMarker
.boolean isRelatedToPrecedingText()
false
and after the text, if the returned value is true
.
Also, when Caret.moveToOffset(int)
or similar offset-based method is invoked, and an inlay exists at the given offset,
caret will be positioned to the left of inlay if returned value is true
, and vice versa.
The value is determined at element's creation (see or {@link InlayModel#addBlockElement(int, boolean, boolean, EditorCustomElementRenderer)}
.
VisualPosition getVisualPosition()
java.awt.Rectangle getBounds()
null
otherwiseT getRenderer()
int getWidthInPixels()
update()
method should be called.int getHeightInPixels()
update()
method should be called.GutterIconRenderer getGutterIconRenderer()
GutterIconRenderer
instance defining an icon displayed in gutter, and associated actions (supported for block inlays
at the moment). This provider is defined at inlay's creation using information returned by inlay's renderer. To change it,
update()
method should be called.@Deprecated default void updateSize()
update()
instead.void update()
void repaint()