Package org.zkoss.zk.ui.event
Class SelectEvent<T extends Component,E>
java.lang.Object
org.zkoss.zk.ui.event.Event
org.zkoss.zk.ui.event.SelectEvent<T,E>
- All Implemented Interfaces:
Serializable
Represents an event cause by user's the list selection is changed
at the client.
- Author:
- tomyeh
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceSelectEvent.SelectedObjectHandler<T extends Component>A handle to retrieve selected objects from selected items (components) if possible. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSelectEvent(String name, Component target, Set<T> selectedItems) Constructs a selection event.SelectEvent(String name, Component target, Set<T> selectedItems, Set<T> previousSelectedItems, Set<T> unselectedItems, Set<E> selectedObjects, Set<E> prevSelectedObjects, Set<E> unselectedObjects, T ref, Object data, int keys) Constructs a selection event containing the data objects that model provided.Constructs a selection event.Constructs a selection event. -
Method Summary
Modifier and TypeMethodDescriptionfinal intgetKeys()Returns what keys were pressed when the mouse is clicked, or 0 if none of them was pressed.Returns the previous selected items (never null).Returns the previous selected objects.Returns the reference item that is the component causing the onSelect event(select or deselect) to be fired.Returns the selected items (never null).Returns the selected objects (never null).static final <T extends Component,E>
SelectEvent<T,E> getSelectEvent(AuRequest request) Converts an AU request to a select event.static final <T extends Component,E>
SelectEvent<T,E> getSelectEvent(AuRequest request, SelectEvent.SelectedObjectHandler<T> handler) Converts an AU request to a select event.Returns the unselected items.Returns the unselected objects.Methods inherited from class org.zkoss.zk.ui.event.Event
getData, getEvent, getName, getPage, getTarget, isPropagatable, stopPropagation, toString
-
Field Details
-
ALT_KEY
public static final int ALT_KEYIndicates whether the Alt key is pressed. It might be returned as part ofgetKeys().- See Also:
-
CTRL_KEY
public static final int CTRL_KEYIndicates whether the Ctrl key is pressed. It might be returned as part ofgetKeys().- See Also:
-
SHIFT_KEY
public static final int SHIFT_KEYIndicates whether the Shift key is pressed. It might be returned as part ofgetKeys().- See Also:
-
-
Constructor Details
-
SelectEvent
Constructs a selection event.- Parameters:
selectedItems- a set of items that shall be selected.
-
SelectEvent
Constructs a selection event.- Parameters:
selectedItems- a set of items that shall be selected.
-
SelectEvent
Constructs a selection event. -
SelectEvent
public SelectEvent(String name, Component target, Set<T> selectedItems, Set<T> previousSelectedItems, Set<T> unselectedItems, Set<E> selectedObjects, Set<E> prevSelectedObjects, Set<E> unselectedObjects, T ref, Object data, int keys) Constructs a selection event containing the data objects that model provided.
-
-
Method Details
-
getSelectEvent
Converts an AU request to a select event.- Since:
- 5.0.0
-
getSelectEvent
public static final <T extends Component,E> SelectEvent<T,E> getSelectEvent(AuRequest request, SelectEvent.SelectedObjectHandler<T> handler) Converts an AU request to a select event.- Since:
- 6.0.0
-
getSelectedItems
Returns the selected items (never null). -
getPreviousSelectedItems
Returns the previous selected items (never null).- Since:
- 7.0.0
-
getPreviousSelectedObjects
Returns the previous selected objects. The information is available only when the target component has a model.- Since:
- 7.0.1
-
getUnselectedItems
Returns the unselected items.- Since:
- 7.0.1
-
getUnselectedObjects
Returns the unselected objects. The information is available only when the target component has a model.- Since:
- 7.0.1
-
getSelectedObjects
Returns the selected objects (never null). The information is available only when the target component has a model.- Since:
- 6.0.0
-
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 ofgetSelectedItems().- 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 ofCTRL_KEY,SHIFT_KEYandALT_KEY.- Since:
- 3.6.0
-