Package com.iizix.api.ui
Class UISelectionEvent
- All Implemented Interfaces:
IMessageBox
The UI Selection Event is fired when the UI selection changes for a component, or when connected to the panel, for every child item in it.
- Author:
- Christopher Mindus
Nested Class Summary
Nested classes/interfaces inherited from interface com.iizix.gyro.IMessageBox
IMessageBox.Icon
Field Summary
Fields inherited from interface com.iizix.gyro.IMessageBox
ICON_ERROR, ICON_INFORMATION, ICON_MAP, ICON_NONE, ICON_QUESTION, ICON_WARNING
Constructor Summary
ConstructorDescriptionUISelectionEvent
(UIComp source, IUISelection selection) Constructs the event for a change without a trigger source.UISelectionEvent
(UIComp source, IUISelection selection, GProp<?> trigger) Constructs the event for a change event with a property being the trigger source, e.g.Method Summary
Modifier and TypeMethodDescriptionGets the selection as an animated single indexed selection.Gets the selection as a boolean selection.int
Gets the check state.int
Gets the first selected index.Gets the selection as an indexed selection.int[]
Gets the selected indicies, if the selection is index based.Gets the selection.Gets the selection as a single indexed selection.Gets the UI component that is the source of the event.GProp<?>
Gets the trigger property being the source of the event.Gets the selection as a tri-state selection.boolean
Returns if the state is checked.boolean
isOFF()
Returns if the selection is "off".boolean
isON()
Returns if the selection is "on".boolean
Returns the selection state.boolean
Returns if the state is third state, i.e.boolean
Returns if the boolean-based selection is not set.boolean
Returns if the tri-state-based selection state is unselected.protected String
Gets the parameter string.Methods inherited from class com.iizix.api.ui.UIBaseEvent
getAppSessionGyro, getClientSessionGyro, getContainerFirstUIComponent, getContainerFirstUIComponentNull, getFirstUIComponent, getFirstUIComponentNull, getPanelUIComponent, getPanelUIComponentNull, getUIPanel, getVirtualSpace
Methods inherited from class com.iizix.api.BaseEvent
getAction, getAction2, getActionNull, getActionNull2, getField, getField2, getFieldNull, getFieldNull2, getGroup, getGroup2, getGroupNull, getGroupNull2, getTable, getTable2, getTableNull, getTableNull2, getTime, getVirtualizedVirtualSpace, getVSComponent, getVSComponent2, getVSComponentNull, getVSComponentNull2, messageBox, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.iizix.gyro.IMessageBox
messageBox, messageBox, messageBox
Constructor Details
UISelectionEvent
Constructs the event for a change without a trigger source.- Parameters:
source
- The source.selection
- The selection.- Throws:
NullPointerException
- If the source or selection is null.
UISelectionEvent
Constructs the event for a change event with a property being the trigger source, e.g. an UIGrid or UICheckBox.- Parameters:
source
- The source.selection
- The selection.trigger
- The trigger property.- Throws:
NullPointerException
- If the source or selection is null.
Method Details
getTrigger
Gets the trigger property being the source of the event.- Returns:
- An instance of e.g. an UIButton, UICheckBox, a VS component or null if the trigger is not a property.
getSource
Gets the UI component that is the source of the event.getSelection
Gets the selection.- Returns:
- The selection.
getFirstSelectedIndex
public int getFirstSelectedIndex()Gets the first selected index.- Returns:
- The first index in the current selection, or -1 for none or if selection is not index based.
getSelectedIndicies
public int[] getSelectedIndicies()Gets the selected indicies, if the selection is index based.- Returns:
- A new array of the selected indices (that may be modified to your liking), or a static zero in length array for no selection (or selection is not index based).
getIndexedSelection
Gets the selection as an indexed selection.- Returns:
- The selection instance, or null if the selection is not an indexed selection.
getSingleIndexedSelection
Gets the selection as a single indexed selection.- Returns:
- The selection instance, or null if the selection is not a single indexed selection.
getAnimatedSingleIndexedSelection
Gets the selection as an animated single indexed selection.- Returns:
- The selection instance, or null if the selection is not an animated single indexed selection.
isSelected
public boolean isSelected()Returns the selection state.- Returns:
- true if selected, false if unselected or not boolean-based selection.
isUnselectedBoolean
public boolean isUnselectedBoolean()Returns if the boolean-based selection is not set.- Returns:
- true if unselected, false if selected or not boolean-based selection.
isON
public boolean isON()Returns if the selection is "on".- Returns:
- true if on, false if off or not boolean-based selection.
isOFF
public boolean isOFF()Returns if the selection is "off".- Returns:
- true if off, false if on or not boolean-based selection.
getBooleanSelection
Gets the selection as a boolean selection.- Returns:
- The selection instance, or null if the selection is not a boolean selection.
getCheckState
public int getCheckState()Gets the check state.- Returns:
- Returns 0={$link #UNSELECTED}, 1={$link #CHECKED}, 2={$link #THIRD_STATE} or -1 if the selection is not a tri-state-based selection.
isChecked
public boolean isChecked()Returns if the state is checked.- Returns:
- true if checked, false if unselected, in third state or the selection is not a tri-state-based selection.
isUnselectedTriState
public boolean isUnselectedTriState()Returns if the tri-state-based selection state is unselected.- Returns:
- true if unchecked, false if checked, in third state or the selection is not a tri-state-based selection.
isThirdState
public boolean isThirdState()Returns if the state is third state, i.e. neither checked nor unselected.- Returns:
- true if third state, false if checked, unselected or the selection is not a tri-state-based selection.
getTriStateSelection
Gets the selection as a tri-state selection.- Returns:
- The selection instance, or null if the selection is not a tri-state selection.
paramString
Gets the parameter string.- Overrides:
paramString
in classBaseEvent<UIComp>