com.togethersoft.openapi.ide.editor
Interface IdeEditorSelection


public interface IdeEditorSelection

Represents a selection within a document. It is possible to get or set the start, or the end positions of this selection.

To select the whole line you should set the selection's end to the beginning of the next line. For example,
to select the line #20:


import com.togethersoft.openapi.util.text.TextPosition;
...
IdeEditorSelection selection = someEditor.getSelection(IdeEditorSelectionType.PRIMARY);
selection.setSelectionStart(new TextPosition(20,1));
selection.setSelectionEnd(new TextPosition(21,1));

Author:
TogetherSoft
Since: Together 3.0
See Also: IdeEditorSelectionType, IdeEditor.getSelection(java.lang.String)

Method Summary
 TextPositiongetSelectionEnd()
          Returns a TextPosition object containing information about the end of this selection.
 TextPositiongetSelectionStart()
          Returns a TextPosition object containing information about the start of this selection.
 voidsetSelectionEnd(TextPosition position)
          Sets the end position of this selection.
 voidsetSelectionStart(TextPosition position)
          Sets the start position of this selection.

Method Detail

getSelectionEnd

public TextPosition getSelectionEnd()
Returns a TextPosition object containing information about the end of this selection.
Returns: a TextPosition
See Also:
TextPosition

getSelectionStart

public TextPosition getSelectionStart()
Returns a TextPosition object containing information about the start of this selection.
Returns: a TextPosition
See Also:
TextPosition

setSelectionEnd

public void setSelectionEnd(TextPosition position)
Sets the end position of this selection.
Parameters:
position a TextPosition instance
See Also:
TextPosition

setSelectionStart

public void setSelectionStart(TextPosition position)
Sets the start position of this selection.
Parameters:
position a TextPosition instance
See Also:
TextPosition