Package ro.sync.ecss.extensions.api
Interface AuthorSelectionModel
-
- All Known Subinterfaces:
AuthorSelectionAndCaretModel
@API(type=NOT_EXTENDABLE, src=PUBLIC) public interface AuthorSelectionModel
Get the Author selection model containing access to all Author selection intervals and methods for adding simple and multiple selections.- Since:
- 14
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addSelection(int startOffset, int endOffset)
Select the interval between start and end offset.void
addSelectionIntervals(java.util.List<ContentInterval> intervals, boolean scrollToVisible)
Add Author editor page selection intervals.void
clearSelection()
Clears all selections from Author editor page and resets the selection interpretation mode (seegetSelectionInterpretationMode()
).SelectionInterpretationMode
getSelectionInterpretationMode()
Get the interpretation mode of the actual selection from the Author editor page.ContentInterval
getSelectionInterval()
Get the current selection interval.java.util.List<ContentInterval>
getSelectionIntervals()
Get all Author editor page selection intervals.boolean
hasMultipleSelection()
Check if the Author editor page has multiple selections.boolean
hasSelection()
Check if the Author editor page has selection.void
setSelection(int startOffset, int endOffset)
Select the interval between start and end offset.void
setSelection(int startOffset, int endOffset, boolean scrollToBVisible)
Select the interval between start and end offset.void
setSelectionInterpretationMode(SelectionInterpretationMode interpretationMode)
Impose the interpretation mode of the actual selection from the Author editor page.void
setSelectionIntervals(java.util.List<ContentInterval> intervals, boolean scrollToVisible)
Sets the Author editor page selection intervals.
-
-
-
Method Detail
-
setSelectionInterpretationMode
void setSelectionInterpretationMode(SelectionInterpretationMode interpretationMode)
Impose the interpretation mode of the actual selection from the Author editor page.
SeeSelectionInterpretationMode
for more details about the interpretation of selection in Author mode.
This interpretation mode is reseted when the next caret moved is performed or another interpretation mode is imposed.- Parameters:
interpretationMode
- The selection interpretation mode.
-
getSelectionInterpretationMode
SelectionInterpretationMode getSelectionInterpretationMode()
Get the interpretation mode of the actual selection from the Author editor page.
SeeSelectionInterpretationMode
for more details about the interpretation of selection in Author mode.
This interpretation mode is reseted when the next caret moved is performed or another interpretation mode is imposed.- Returns:
- The selection interpretation mode.
-
getSelectionIntervals
java.util.List<ContentInterval> getSelectionIntervals()
Get all Author editor page selection intervals. EachContentInterval
contains the inclusive start selection offset and the exclusive end selection offset.
The selection intervals are added to the list in the same order in which the selections are made in the Author editor page. If the caret is not inside a selection the last selection interval points to the caret offset (bothContentInterval.getStartOffset()
andContentInterval.getEndOffset()
will return the caret position). Otherwise, the lastContentInterval
from the list corresponds with the last selection made in the editor.
This method never returnsnull
. If there is no selection, the list contains a singleContentInterval
that points to the caret offset.- Returns:
- the list containing all the Author editor page selection intervals.
-
getSelectionInterval
ContentInterval getSelectionInterval()
Get the current selection interval. This is the last selection made in the Author editor page (the last selection from thegetSelectionIntervals()
selections list). If the caret offset is not included in a selection range, the selection interval points to the caret offset (bothContentInterval.getStartOffset()
andContentInterval.getEndOffset()
will return the caret position).
TheContentInterval
contains the inclusive start selection offset and the exclusive end selection offset.
This method never returnsnull
. If there is no selection, both the start and end offset of the interval will be the caret position.- Returns:
- The interval of the current selection.
-
hasSelection
boolean hasSelection()
Check if the Author editor page has selection.- Returns:
true
if there is a selection in Author editor page.
-
hasMultipleSelection
boolean hasMultipleSelection()
Check if the Author editor page has multiple selections.- Returns:
true
if there are at least two selections in Author editor page.
-
setSelection
void setSelection(int startOffset, int endOffset)
Select the interval between start and end offset.
This selection interval is considered to be the current one (the one that will be returned by thegetSelectionInterval()
method).
The previous Author selections are discarded.- Parameters:
startOffset
- Inclusive start offsetendOffset
- Exclusive end offset
-
setSelection
void setSelection(int startOffset, int endOffset, boolean scrollToBVisible)
Select the interval between start and end offset.
This selection interval is considered to be the current one (the one that will be returned by thegetSelectionInterval()
method).
The previous Author selections are discarded.- Parameters:
startOffset
- Inclusive start offsetendOffset
- Exclusive end offsetscrollToBVisible
-true
to scroll to visible
-
addSelection
void addSelection(int startOffset, int endOffset)
Select the interval between start and end offset.
This selection interval is considered to be the current one (the one that will be returned by thegetSelectionInterval()
method).
The previous Author selections are kept. CallgetSelectionIntervals()
method to get all the selection intervals from Author editor page.- Parameters:
startOffset
- Inclusive start offsetendOffset
- Exclusive end offset
-
clearSelection
void clearSelection()
Clears all selections from Author editor page and resets the selection interpretation mode (seegetSelectionInterpretationMode()
). The caret will remain in the same position.
After this method is executed,getSelectionIntervals()
will return a single selection interval that points to the caret offset (bothContentInterval.getStartOffset()
andContentInterval.getEndOffset()
will return the caret position).
-
setSelectionIntervals
void setSelectionIntervals(java.util.List<ContentInterval> intervals, boolean scrollToVisible)
Sets the Author editor page selection intervals. EachContentInterval
contains the inclusive start selection offset and the exclusive end selection offset.
The selection intervals are added to the Author editor page order in which they are in the list. The last selection interval end offset will set the caret position.
- Parameters:
intervals
- the list containing all the Author editor page selection intervals.scrollToVisible
- Iftrue
the start offset of the last interval will be scrolled to visible.- Since:
- 17.1
-
addSelectionIntervals
void addSelectionIntervals(java.util.List<ContentInterval> intervals, boolean scrollToVisible)
Add Author editor page selection intervals. EachContentInterval
contains the inclusive start selection offset and the exclusive end selection offset.
The selection intervals are added to the Author editor page order in which they are in the list. The last selection interval end offset will set the caret position.
- Parameters:
intervals
- the list containing all the Author editor page selection intervals.scrollToVisible
- Iftrue
the start offset of the last interval will be scrolled to visible.- Since:
- 18
-
-