Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.3.0)

E17493-04


oracle.javatools.editor
Interface EditorSelection

All Known Implementing Classes:
EditorSelectionColumns, EditorSelectionWrap

public interface EditorSelection

An EditorSelection is a mechanism to determine the selection behaviour of an BasicEditorPane. This means determining the state of the selection (i.e. from where to where), What test is actually selected, and the shape of the selection. EditorSelections would also usually implement custom cut, copy, paste, delete, etc actions when triggered on the editor.


Method Summary
 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

 

Method Detail

getSelectionStart

int getSelectionStart()
Returns:
The offset of selection start (usually the caret position)

getSelectionEnd

int getSelectionEnd()
Returns:
The offset of selection end. May be identical to selection start which may indicate no selection.

getSelectedText

java.lang.String getSelectedText()
Returns:
The text currently covered by selection

updateSelectionHighlight

void updateSelectionHighlight(HighlightLayer layer,
                              HighlightStyle caretStyle)
Update the Editors selection highlight layer in response to a possible change in selection
Parameters:
layer - The selection highlight layer
caretStyle -

install

void install(BasicEditorPane editor)
Associate the editor selection with an editor
Parameters:
editor -

deinstall

void deinstall()
Disassociate the editor selection from an editor

setStartSelectionPoint

void setStartSelectionPoint(java.awt.Point p)
Let the selection know the point (in editor coordinates) where the selection start is designated. We can't just rely on editor.getCaret() as this will return an offset, sometimes the selection start point will be past the end of the row and not specifically identified by an offset
Parameters:
p - the Point where the selection begin

setEndSelectionPoint

void setEndSelectionPoint(java.awt.Point p)
Let the selection know the point (in editor coordinates) where the selection end is designated. We can't just rely on editor.getCaret() as this will return an offset, sometimes the selection end point will be past the end of the row and not specifically identified by an offset
Parameters:
p - the Point where the selection bounds ends

clearSelectionHighlights

void clearSelectionHighlights(HighlightLayer selectionLayer)
Clear the selection by removing any selection highlighting and permorming any other internal clear operations.
Parameters:
selectionLayer -

deleteSelection

void deleteSelection()
                     throws javax.swing.text.BadLocationException
Remove the currently selected text (if any) from the document
Throws:
javax.swing.text.BadLocationException

insertText

void insertText(int offset,
                java.lang.String text)
                throws javax.swing.text.BadLocationException
Insert the given text at the given offset (Different selections will handle things like newline characters differently).
Parameters:
offset -
text -
Throws:
javax.swing.text.BadLocationException

isInSelection

boolean isInSelection(int offset)
Returns whether the given offset lies within the current selection bounds
Parameters:
offset -
Returns:

selectAll

void selectAll()
Selects all characters in the document

canSupportEditor

boolean canSupportEditor(BasicEditorPane editorPane)
Indicates whether the EditorSelection can support its selection type on te given editor pane
Parameters:
editorPane -
Returns:
true if the selection is suitable for the given editor

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.3.0)

E17493-04


Copyright © 1997, 2012, Oracle. All rights reserved.