Package org.zkoss.zk.ui.event
Class SelectionEvent
java.lang.Object
org.zkoss.zk.ui.event.Event
org.zkoss.zk.ui.event.SelectionEvent
- All Implemented Interfaces:
Serializable
Represents an event cause by user's the active selection which is a
highlighted block of text.
- Author:
- jumperchen
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSelectionEvent(String name, Component target, int start, int end, String txt) Constructs a selection event. -
Method Summary
Modifier and TypeMethodDescriptionintgetEnd()Returns the selected text's end position.Returns the selected text contained in this text.static final SelectionEventgetSelectionEvent(AuRequest request) Converts an AU request to a selection event.intgetStart()Returns the selected text's start position.Methods inherited from class org.zkoss.zk.ui.event.Event
getData, getEvent, getName, getPage, getTarget, isPropagatable, stopPropagation, toString
-
Constructor Details
-
SelectionEvent
Constructs a selection event.
-
-
Method Details
-
getSelectionEvent
Converts an AU request to a selection event.- Since:
- 5.0.0
-
getEnd
public int getEnd()Returns the selected text's end position.- Returns:
- the end position >= 0
-
getStart
public int getStart()Returns the selected text's start position.- Returns:
- the start position >= 0
-
getSelectedText
Returns the selected text contained in this text. If the selection is null or the document empty, returns empty string.
-