public class AceSelection
extends java.lang.Object
Constructor and Description |
---|
AceSelection(com.google.gwt.core.client.JavaScriptObject selection)
Constructor for AceSelection
|
Modifier and Type | Method and Description |
---|---|
void |
addSelectionListener(AceSelectionListener listener)
Register listener for selection change events.
|
void |
clearSelection()
Clear selection.
|
AceEditorCursorPosition |
getSelectionAnchor()
Give starting position of selection (opposite to position where cursor is located).
|
AceEditorCursorPosition |
getSelectionLead()
Give position of leading end of selection (where cursor is located).
|
boolean |
isBackwards()
Check if selection leading position is located before anchor position
|
boolean |
isEmpty()
Check if selection is empty.
|
boolean |
isMultiLine()
Check if selection contains several lines.
|
void |
removeSelectionListener(AceSelectionListener listener)
Unregister listener for selection change events.
|
void |
select(int fromRow,
int fromColumn,
int toRow,
int toColumn)
Select text fragment between two positions
|
void |
selectAll()
Select the whole text.
|
void |
selectLine()
Select line where cursor is located.
|
public AceSelection(com.google.gwt.core.client.JavaScriptObject selection)
selection
- Ace Selection java-script object (returned from editor.getSession().getSelection())public void addSelectionListener(AceSelectionListener listener)
listener
- implementation of a listener for selection change eventspublic void removeSelectionListener(AceSelectionListener listener)
listener
- implementation of a listener for selection change eventspublic boolean isEmpty()
public boolean isMultiLine()
public AceEditorCursorPosition getSelectionLead()
public AceEditorCursorPosition getSelectionAnchor()
public boolean isBackwards()
public void clearSelection()
public void selectAll()
public void select(int fromRow, int fromColumn, int toRow, int toColumn)
fromRow
- row of selection anchorfromColumn
- columns of selection anchortoRow
- row of selection leading positiontoColumn
- column of selection leading positionpublic void selectLine()