Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.9.0)

E52944-01


oracle.javatools.editor
Class EditorSelectionWrap

java.lang.Object
  extended by oracle.javatools.editor.EditorSelectionWrap

All Implemented Interfaces:
ActionHookInvoker, EditorSelection

public final class EditorSelectionWrap
extends java.lang.Object
implements EditorSelection, ActionHookInvoker

An EditorSelection supporting the standard type of selection familiar to most users. Selection beings at the selection start offset and then spans every character to selection end (inclusive) The class leaves the cut, copy, and paste implementation to the standard mechanism - in BasicEditorPane hierarchy, unless an addin or plugin overrides the behaviour.


Constructor Summary
EditorSelectionWrap()
           

 

Method Summary
 boolean canSupportEditor(BasicEditorPane editorPane)
          Wrap selection is the 'standard' selection that editor panes support, so this method always returns true.
 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
 void duplicateSelection()
          Copies the selected text amd places the copy immediately after he original selection.
 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 invokeAction(java.lang.String actionKey)
          Invokes the Action corresponding to the given actionKey.
 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

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

EditorSelectionWrap

public EditorSelectionWrap()

Method Detail

getSelectionStart

public int getSelectionStart()
Specified by:
getSelectionStart in interface EditorSelection
Returns:
The offset of selection start (usually the caret position)

getSelectionEnd

public int getSelectionEnd()
Specified by:
getSelectionEnd in interface EditorSelection
Returns:
The offset of selection end. May be identical to selection start which may indicate no selection.

getSelectedText

public java.lang.String getSelectedText()
Specified by:
getSelectedText in interface EditorSelection
Returns:
The text currently covered by selection

duplicateSelection

public void duplicateSelection()
Copies the selected text amd places the copy immediately after he original selection. Aft er the operation completes the newly inserted region will be selected. The clipboard contents are unnaffected by this operation. If there is no selection thsis operation will do nothing.

updateSelectionHighlight

public void updateSelectionHighlight(HighlightLayer layer,
                                     HighlightStyle caretStyle)
Description copied from interface: EditorSelection
Update the Editors selection highlight layer in response to a possible change in selection
Specified by:
updateSelectionHighlight in interface EditorSelection
Parameters:
layer - The selection highlight layer

install

public void install(BasicEditorPane editor)
Description copied from interface: EditorSelection
Associate the editor selection with an editor
Specified by:
install in interface EditorSelection

deinstall

public void deinstall()
Description copied from interface: EditorSelection
Disassociate the editor selection from an editor
Specified by:
deinstall in interface EditorSelection

invokeAction

public boolean invokeAction(java.lang.String actionKey)
Description copied from interface: ActionHookInvoker
Invokes the Action corresponding to the given actionKey.
Specified by:
invokeAction in interface ActionHookInvoker
Parameters:
actionKey - the published key for the action
Returns:
true if the action is handled, false otherwise

setStartSelectionPoint

public void setStartSelectionPoint(java.awt.Point p)
Description copied from interface: EditorSelection
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
Specified by:
setStartSelectionPoint in interface EditorSelection
Parameters:
p - the Point where the selection begin

setEndSelectionPoint

public void setEndSelectionPoint(java.awt.Point p)
Description copied from interface: EditorSelection
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
Specified by:
setEndSelectionPoint in interface EditorSelection
Parameters:
p - the Point where the selection bounds ends

clearSelectionHighlights

public void clearSelectionHighlights(HighlightLayer selectionLayer)
Description copied from interface: EditorSelection
Clear the selection by removing any selection highlighting and permorming any other internal clear operations.
Specified by:
clearSelectionHighlights in interface EditorSelection

deleteSelection

public void deleteSelection()
                     throws javax.swing.text.BadLocationException
Description copied from interface: EditorSelection
Remove the currently selected text (if any) from the document
Specified by:
deleteSelection in interface EditorSelection
Throws:
javax.swing.text.BadLocationException

insertText

public void insertText(int offset,
                       java.lang.String text)
                throws javax.swing.text.BadLocationException
Description copied from interface: EditorSelection
Insert the given text at the given offset (Different selections will handle things like newline characters differently).
Specified by:
insertText in interface EditorSelection
Throws:
javax.swing.text.BadLocationException

isInSelection

public boolean isInSelection(int offset)
Description copied from interface: EditorSelection
Returns whether the given offset lies within the current selection bounds
Specified by:
isInSelection in interface EditorSelection
Returns:

selectAll

public void selectAll()
Description copied from interface: EditorSelection
Selects all characters in the document
Specified by:
selectAll in interface EditorSelection

canSupportEditor

public boolean canSupportEditor(BasicEditorPane editorPane)
Wrap selection is the 'standard' selection that editor panes support, so this method always returns true.
Specified by:
canSupportEditor in interface EditorSelection
Parameters:
editorPane -
Returns:
true

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.9.0)

E52944-01


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