public class IlvTextEditor extends IlvReshapeSelection implements ClipboardOwner
IlvTextSelection
.
It can handle mouse and key events and then edit the selected graphic object
implementing the interface IlvTextInterface
.
While editing the selected label, you can perform the following actions with your mouse:
Tips
You can combine the <Shift> key and arrow keys to extend the selection zone.
You can also do Copy/Paste by using the Ctrl+C and Ctrl+V keys.
During the edit session you can move and reshape the selected text object:
IlvLabel
);
IlvTextSelection
,
Serialized FormConstructor and Description |
---|
IlvTextEditor()
Creates a new
IlvTextEditor . |
Modifier and Type | Method and Description |
---|---|
protected void |
copySelection(IlvTextInterface text,
int startIndex,
int endIndex)
Copies the region from the input text object to the clipboard.
|
protected void |
deleteSelection(IlvTextInterface text,
int startIndex,
int endIndex)
Delete the region from the input text object.
|
void |
lostOwnership(Clipboard aClipboard,
Transferable aContents)
Empty implementation of the ClipboardOwner interface.
|
boolean |
processEvent(IlvGraphic obj,
AWTEvent event,
IlvObjectInteractorContext context)
Handles mouse or key events to edit a selected graphic object implementing
IlvTextInterface . |
protected void |
replaceSelection(IlvTextInterface text,
int startIndex,
int endIndex,
AttributedString s)
Replace the region from the input text object.
|
protected void |
replaceSelection(IlvTextInterface text,
int startIndex,
int endIndex,
String s)
Replace the region from the input text object.
|
drawGhost, drawGhost, getBoundingBox, getCursor, getPreserveAspectModifier, getPreserveAspectModifierEx, handleButtonDown, handleButtonDragged, handleButtonUp, handleExpose, isOpaqueMode, isPredictionCursorMode, isPreserveAspectModifierDown, onEnter, onExit, reshapeObject, setOpaqueMode, setPredictionCursorMode, setPreserveAspectModifier
Get, Put
public boolean processEvent(IlvGraphic obj, AWTEvent event, IlvObjectInteractorContext context)
IlvTextInterface
.processEvent
in class IlvReshapeSelection
obj
- Should be an IlvTextSelection
.event
- The mouse or key event.context
- The interaction context.public void lostOwnership(Clipboard aClipboard, Transferable aContents)
lostOwnership
in interface ClipboardOwner
protected void deleteSelection(IlvTextInterface text, int startIndex, int endIndex)
label.substring(startIndex, endIndex)
is removed from the label of the text object.text
- The text objectstartIndex
- The index of the first character to be removed.endIndex
- The index of the first character that is not anymore
removed.protected void replaceSelection(IlvTextInterface text, int startIndex, int endIndex, String s)
label.substring(startIndex, endIndex)
is replaced from the label of the text object.text
- The text objectstartIndex
- The index of the first character to be replaced.endIndex
- The index of the first character that is not anymore
replaced.s
- The replacement string.protected void replaceSelection(IlvTextInterface text, int startIndex, int endIndex, AttributedString s)
label.substring(startIndex, endIndex)
is replaced from the label of the text object.
This variant is used when pasting an attributed string from the clipboard.text
- The text objectstartIndex
- The index of the first character to be replaced.endIndex
- The index of the first character that is not anymore
replaced.s
- The replacement string as attributed text.protected void copySelection(IlvTextInterface text, int startIndex, int endIndex)
label.substring(startIndex, endIndex)
is copied from the label of the text object to the clipboard.text
- The text objectstartIndex
- The index of the first character to be removed.endIndex
- The index of the first character that is not anymore
removed.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.