org.zkoss.zk.ui.event
Class SelectionEvent

java.lang.Object
  extended by org.zkoss.zk.ui.event.Event
      extended by org.zkoss.zk.ui.event.SelectionEvent
All Implemented Interfaces:
java.io.Serializable

public class SelectionEvent
extends Event

Represents an event cause by user's the active selection which is a highlighted block of text.

Author:
jumperchen
See Also:
Serialized Form

Constructor Summary
SelectionEvent(java.lang.String name, Component target, int start, int end, java.lang.String txt)
          Constructs a selection event.
 
Method Summary
 int getEnd()
          Returns the selected text's end position.
 java.lang.String getSelectedText()
          Returns the selected text contained in this text.
static SelectionEvent getSelectionEvent(AuRequest request)
          Converts an AU request to a selection event.
 int getStart()
          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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SelectionEvent

public SelectionEvent(java.lang.String name,
                      Component target,
                      int start,
                      int end,
                      java.lang.String txt)
Constructs a selection event.

Method Detail

getSelectionEvent

public static final SelectionEvent getSelectionEvent(AuRequest request)
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

public java.lang.String getSelectedText()
Returns the selected text contained in this text. If the selection is null or the document empty, returns empty string.



Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo