org.zkoss.zk.ui.event
Class SelectEvent

java.lang.Object
  extended by org.zkoss.zk.ui.event.Event
      extended by org.zkoss.zk.ui.event.SelectEvent

public class SelectEvent
extends Event

Represents an event cause by user's the list selection is changed at the client.

Author:
tomyeh

Field Summary
static int ALT_KEY
          Indicates whether the Alt key is pressed.
static int CTRL_KEY
          Indicates whether the Ctrl key is pressed.
static int SHIFT_KEY
          Indicates whether the Shift key is pressed.
 
Constructor Summary
SelectEvent(java.lang.String name, Component target, java.util.Set selectedItems)
          Constructs a selection event.
SelectEvent(java.lang.String name, Component target, java.util.Set selectedItems, Component ref)
          Constructs a selection event.
SelectEvent(java.lang.String name, Component target, java.util.Set selectedItems, Component ref, int keys)
          Constructs a selection event.
 
Method Summary
 int getKeys()
          Returns what keys were pressed when the mouse is clicked, or 0 if none of them was pressed.
 Component getReference()
          Returns the reference item that is the component causing the onSelect event(select or deselect) to be fired.
 java.util.Set getSelectedItems()
          Returns the selected items (never null).
static SelectEvent getSelectEvent(AuRequest request)
          Converts an AU request to a select event.
 
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
 

Field Detail

ALT_KEY

public static final int ALT_KEY
Indicates whether the Alt key is pressed. It might be returned as part of getKeys().

See Also:
Constant Field Values

CTRL_KEY

public static final int CTRL_KEY
Indicates whether the Ctrl key is pressed. It might be returned as part of getKeys().

See Also:
Constant Field Values

SHIFT_KEY

public static final int SHIFT_KEY
Indicates whether the Shift key is pressed. It might be returned as part of getKeys().

See Also:
Constant Field Values
Constructor Detail

SelectEvent

public SelectEvent(java.lang.String name,
                   Component target,
                   java.util.Set selectedItems)
Constructs a selection event.

Parameters:
selectedItems - a set of items that shall be selected.

SelectEvent

public SelectEvent(java.lang.String name,
                   Component target,
                   java.util.Set selectedItems,
                   Component ref)
Constructs a selection event.

Parameters:
selectedItems - a set of items that shall be selected.

SelectEvent

public SelectEvent(java.lang.String name,
                   Component target,
                   java.util.Set selectedItems,
                   Component ref,
                   int keys)
Constructs a selection event.

Parameters:
selectedItems - a set of items that shall be selected.
keys - a combination of CTRL_KEY, SHIFT_KEY and ALT_KEY.
Since:
3.6.0
Method Detail

getSelectEvent

public static final SelectEvent getSelectEvent(AuRequest request)
Converts an AU request to a select event.

Since:
5.0.0

getSelectedItems

public final java.util.Set getSelectedItems()
Returns the selected items (never null).


getReference

public Component getReference()
Returns the reference item that is the component causing the onSelect event(select or deselect) to be fired.

It is null, if the onSelect event is not caused by listbox or tree or combobox. Note: if not multiple, the getReference() is the same with the first item of getSelectedItems().

Since:
3.0.2

getKeys

public final int getKeys()
Returns what keys were pressed when the mouse is clicked, or 0 if none of them was pressed. It is a combination of CTRL_KEY, SHIFT_KEY and ALT_KEY.

Since:
3.6.0


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