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
|
default Selection |
determineMoveDot(int dot,
int mark)
The caret has been asked to move the dot to the given location.
|
default int |
determineSetDot(int dot)
The caret has been asked to set the dot to the given location.
|
void |
duplicate()
Duplicate the current selection.
|
int |
getDot() |
int |
getMark() |
java.lang.String |
getSelectedText() |
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 |
mouseDragged(java.awt.Point point,
int offset)
The mouse was dragged to the given point and offset
|
void |
selectAll()
Selects all characters in the document
|
void |
setDotPoint(java.awt.Point p)
Let the selection know the point (in editor coordinates) where the selection
end is designated.
|
void |
setMarkPoint(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 getMark()
int getDot()
java.lang.String getSelectedText()
void updateSelectionHighlight(HighlightLayer layer, HighlightStyle caretStyle)
layer - The selection highlight layercaretStyle - void install(BasicEditorPane editor)
editor - void deinstall()
void setMarkPoint(java.awt.Point p)
p - the Point where the selection beginvoid setDotPoint(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.BadLocationExceptionvoid insertText(int offset,
java.lang.String text)
throws javax.swing.text.BadLocationException
offset - text - javax.swing.text.BadLocationExceptionboolean isInSelection(int offset)
offset - void selectAll()
void duplicate()
boolean canSupportEditor(BasicEditorPane editorPane)
editorPane - default int determineSetDot(int dot)
dot - location dot is requesting to be placed atdefault Selection determineMoveDot(int dot, int mark)
dot - location dot is requesting to be moved tovoid mouseDragged(java.awt.Point point,
int offset)
point - the point of the dragoffset -