public interface LineWrapPositionStrategy
Modifier and Type | Method and Description |
---|---|
int |
calculateWrapPosition(Document document,
Project project,
int startOffset,
int endOffset,
int maxPreferredOffset,
boolean allowToBeyondMaxPreferredOffset,
boolean isSoftWrap)
Allows to calculate the most appropriate position to wrap target line.
|
int calculateWrapPosition(Document document, Project project, int startOffset, int endOffset, int maxPreferredOffset, boolean allowToBeyondMaxPreferredOffset, boolean isSoftWrap)
document
- target document which text is being processedproject
- target projectstartOffset
- start offset to use with the given text holder (exclusive)endOffset
- end offset to use with the given text holder (exclusive)maxPreferredOffset
- this method is expected to do its best to return offset that belongs to
(startOffset; maxPreferredOffset]
interval. However, it's allowed
to return value from (maxPreferredOffset; endOffset)
interval
unless 'allowToBeyondMaxPreferredOffset'
if 'false'
allowToBeyondMaxPreferredOffset
- indicates if it's allowed to return value from
(maxPreferredOffset; endOffset]
interval in case of inability to
find appropriate offset from (startOffset; maxPreferredOffset]
intervalisSoftWrap
- identifies if current request is for isSoftWrap wrap position(startOffset; endOffset)
interval where
target line should be wrapped OR -1
if no wrapping should be performed