public interface SoftWrapModelEx extends SoftWrapModel
SoftWrapModel
in order to define implementation-specific contract.Modifier and Type | Method and Description |
---|---|
boolean |
addSoftWrapChangeListener(SoftWrapChangeListener listener)
Registers given listener within the current model
|
void |
forceAdditionalColumnsUsage()
Allows to instruct current model to return
'true' from isRespectAdditionalColumns() . |
EditorTextRepresentationHelper |
getEditorTextRepresentationHelper()
Deprecated.
To be removed in version 2021.1
|
int |
getMinDrawingWidthInPixels(SoftWrapDrawingType drawingType)
Allows to ask for the minimal width in pixels required for painting of the given type.
|
java.util.List<? extends SoftWrap> |
getRegisteredSoftWraps() |
int |
getSoftWrapIndex(int offset)
Tries to find index of the target soft wrap at
soft wraps collection . |
boolean |
isRespectAdditionalColumns()
IJ editor defines a notion of
additional columns . |
int |
paint(java.awt.Graphics g,
SoftWrapDrawingType drawingType,
int x,
int y,
int lineHeight)
Asks to paint drawing of target type at the given graphics buffer at the given position.
|
beforeDocumentChangeAtCaret, getSoftWrap, getSoftWrapsForLine, getSoftWrapsForRange, isInsideOrBeforeSoftWrap, isInsideSoftWrap, isSoftWrappingEnabled, isVisible, release
java.util.List<? extends SoftWrap> getRegisteredSoftWraps()
int getSoftWrapIndex(int offset)
soft wraps collection
.
'Target'
soft wrap is the one that starts at the given offset.offset
- target offsetCollections.binarySearch(List, Object)
contract, i.e. non-negative returned
index points to soft wrap that starts at the given offset; '-(negative value) - 1'
points
to position at soft wraps collection
where soft wrap for the given index
should be insertedint paint(java.awt.Graphics g, SoftWrapDrawingType drawingType, int x, int y, int lineHeight)
g
- target graphics buffer to draw indrawingType
- target drawing typex
- target 'x'
coordinate to usey
- target 'y'
coordinate to uselineHeight
- line height used at editorint getMinDrawingWidthInPixels(SoftWrapDrawingType drawingType)
drawingType
- target drawing typeboolean addSoftWrapChangeListener(SoftWrapChangeListener listener)
listener
- listener to registertrue
if given listener was not registered before; false
otherwiseboolean isRespectAdditionalColumns()
additional columns
. They define additional
amount of space to be used during editor component's width calculation (IJ editor perform 'preventive UI component expansion'
when user types near the right edge).
The main idea of soft wraps is to avoid horizontal scrolling, so, when soft wrapping is enabled and succeeds (so that resulting
text layout fits view area's width), additional columns wont be added to the preferred editor width.
This method answers whether the above behaviour should be overridden, and additional columns setting should be respected regardless of
soft wrapping success. This happens when forceAdditionalColumnsUsage()
has been invoked previously.void forceAdditionalColumnsUsage()
'true'
from isRespectAdditionalColumns()
.@Deprecated EditorTextRepresentationHelper getEditorTextRepresentationHelper()