public interface EditorSelection
Modifier and Type | Method and Description |
---|---|
boolean |
canSupportEditor(BasicEditorPane editorPane)
Indicates whether the EditorSelection can support its selection type
on te given editor pane
|
void |
clearSelectionHighlights(HighlightLayer selectionLayer)
Clear the selection by removing any selection highlighting and permorming any other
internal clear operations.
|
void |
deinstall()
Disassociate the editor selection from an editor
|
void |
deleteSelection()
Remove the currently selected text (if any) from the document
|
java.lang.String |
getSelectedText() |
int |
getSelectionEnd() |
int |
getSelectionStart() |
void |
insertText(int offset,
java.lang.String text)
Insert the given text at the given offset (Different selections will handle
things like newline characters differently).
|
void |
install(BasicEditorPane editor)
Associate the editor selection with an editor
|
boolean |
isInSelection(int offset)
Returns whether the given offset lies within the current selection bounds
|
void |
selectAll()
Selects all characters in the document
|
void |
setEndSelectionPoint(java.awt.Point p)
Let the selection know the point (in editor coordinates) where the selection
end is designated.
|
void |
setStartSelectionPoint(java.awt.Point p)
Let the selection know the point (in editor coordinates) where the selection
start is designated.
|
void |
updateSelectionHighlight(HighlightLayer layer,
HighlightStyle caretStyle)
Update the Editors selection highlight layer in response to a possible change
in selection
|
int getSelectionStart()
int getSelectionEnd()
java.lang.String getSelectedText()
void updateSelectionHighlight(HighlightLayer layer, HighlightStyle caretStyle)
layer
- The selection highlight layercaretStyle
- void install(BasicEditorPane editor)
editor
- void deinstall()
void setStartSelectionPoint(java.awt.Point p)
p
- the Point where the selection beginvoid setEndSelectionPoint(java.awt.Point p)
p
- the Point where the selection bounds endsvoid clearSelectionHighlights(HighlightLayer selectionLayer)
selectionLayer
- void deleteSelection() throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationException
void insertText(int offset, java.lang.String text) throws javax.swing.text.BadLocationException
offset
- text
- javax.swing.text.BadLocationException
boolean isInSelection(int offset)
offset
- void selectAll()
boolean canSupportEditor(BasicEditorPane editorPane)
editorPane
-