Oxygen XML Editor 14.2 Author API

ro.sync.ecss.extensions.api
Interface AuthorSelectionModel


@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

*********************************
EXPERIMENTAL - Subject to change
********************************

Please note that this API is not marked as final and it can change in one of the next versions of the application. If you have suggestions, comments about it, please let us know.


Method Summary
 void addSelection(int startOffset, int endOffset)
          Select the interval between start and end offset.
 void clearSelection()
          Clears all selections from Author editor page and resets the selection interpretation mode (see getSelectionInterpretationMode()).
 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 setSelectionInterpretationMode(SelectionInterpretationMode interpretationMode)
          Impose the interpretation mode of the actual selection from the Author editor page.
 

Method Detail

setSelectionInterpretationMode

void setSelectionInterpretationMode(SelectionInterpretationMode interpretationMode)
Impose the interpretation mode of the actual selection from the Author editor page.
See SelectionInterpretationMode 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.
See SelectionInterpretationMode 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. Each ContentInterval 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 (both ContentInterval.getStartOffset() and ContentInterval.getEndOffset() will return the caret position). Otherwise, the last ContentInterval from the list corresponds with the last selection made in the editor.

This method never returns null. If there is no selection, the list contains a single ContentInterval 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 the getSelectionIntervals() selections list). If the caret offset is not included in a selection range, the selection interval points to the caret offset (both ContentInterval.getStartOffset() and ContentInterval.getEndOffset() will return the caret position).
The ContentInterval contains the inclusive start selection offset and the exclusive end selection offset.

This method never returns null. 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 the getSelectionInterval() method).

The previous Author selections are discarded.

Parameters:
startOffset - Inclusive start offset
endOffset - Exclusive end offset

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 the getSelectionInterval() method).

The previous Author selections are kept. Call getSelectionIntervals() method to get all the selection intervals from Author editor page.

Parameters:
startOffset - Inclusive start offset
endOffset - Exclusive end offset

clearSelection

void clearSelection()
Clears all selections from Author editor page and resets the selection interpretation mode (see getSelectionInterpretationMode()). 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 (both ContentInterval.getStartOffset() and ContentInterval.getEndOffset() will return the caret position).


Oxygen XML Editor 14.2 Author API

© Copyright SyncRO Soft SRL 2002 - 2013. All rights reserved.