|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.zkoss.zk.ui.event.Event org.zkoss.zk.ui.event.SelectEvent<T,E>
public class SelectEvent<T extends Component,E>
Represents an event cause by user's the list selection is changed at the client.
Nested Class Summary | |
---|---|
static interface |
SelectEvent.SelectedObjectHandler<T extends Component>
A handle to retrieve selected objects from selected items (components) if possible. |
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<T> selectedItems)
Constructs a selection event. |
|
SelectEvent(java.lang.String name,
Component target,
java.util.Set<T> selectedItems,
java.util.Set<T> previousSelectedItems,
java.util.Set<T> unselectedItems,
java.util.Set<E> selectedObjects,
java.util.Set<E> prevSelectedObjects,
java.util.Set<E> unselectedObjects,
T ref,
java.lang.Object data,
int keys)
Constructs a selection event containing the data objects that model provided. |
|
SelectEvent(java.lang.String name,
Component target,
java.util.Set<T> selectedItems,
T ref)
Constructs a selection event. |
|
SelectEvent(java.lang.String name,
Component target,
java.util.Set<T> selectedItems,
T 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. |
|
java.util.Set<T> |
getPreviousSelectedItems()
Returns the previous selected items (never null). |
|
java.util.Set<E> |
getPreviousSelectedObjects()
Returns the previous selected objects. |
|
T |
getReference()
Returns the reference item that is the component causing the onSelect event(select or deselect) to be fired. |
|
java.util.Set<T> |
getSelectedItems()
Returns the selected items (never null). |
|
java.util.Set<E> |
getSelectedObjects()
Returns the selected objects (never null). |
|
static
|
getSelectEvent(AuRequest request)
Converts an AU request to a select event. |
|
static
|
getSelectEvent(AuRequest request,
SelectEvent.SelectedObjectHandler<T> handler)
Converts an AU request to a select event. |
|
java.util.Set<T> |
getUnselectedItems()
Returns the unselected items. |
|
java.util.Set<E> |
getUnselectedObjects()
Returns the unselected objects. |
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 |
---|
public static final int ALT_KEY
getKeys()
.
public static final int CTRL_KEY
getKeys()
.
public static final int SHIFT_KEY
getKeys()
.
Constructor Detail |
---|
public SelectEvent(java.lang.String name, Component target, java.util.Set<T> selectedItems)
selectedItems
- a set of items that shall be selected.public SelectEvent(java.lang.String name, Component target, java.util.Set<T> selectedItems, T ref)
selectedItems
- a set of items that shall be selected.public SelectEvent(java.lang.String name, Component target, java.util.Set<T> selectedItems, T ref, int keys)
selectedItems
- a set of items that shall be selected.keys
- a combination of CTRL_KEY
, SHIFT_KEY
and ALT_KEY
.public SelectEvent(java.lang.String name, Component target, java.util.Set<T> selectedItems, java.util.Set<T> previousSelectedItems, java.util.Set<T> unselectedItems, java.util.Set<E> selectedObjects, java.util.Set<E> prevSelectedObjects, java.util.Set<E> unselectedObjects, T ref, java.lang.Object data, int keys)
selectedItems
- a set of items that shall be selected.selectedObjects
- a set of data objects that shall be selected.data
- an arbitrary datakeys
- a combination of CTRL_KEY
, SHIFT_KEY
and ALT_KEY
.Method Detail |
---|
public static final <T extends Component,E> SelectEvent<T,E> getSelectEvent(AuRequest request)
public static final <T extends Component,E> SelectEvent<T,E> getSelectEvent(AuRequest request, SelectEvent.SelectedObjectHandler<T> handler)
public final java.util.Set<T> getSelectedItems()
public final java.util.Set<T> getPreviousSelectedItems()
public final java.util.Set<E> getPreviousSelectedObjects()
public final java.util.Set<T> getUnselectedItems()
public final java.util.Set<E> getUnselectedObjects()
public final java.util.Set<E> getSelectedObjects()
public T getReference()
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()
.
public final int getKeys()
CTRL_KEY
, SHIFT_KEY
and ALT_KEY
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |