Package com.iizix.api.ui
Class UISelectionEvent
- java.lang.Object
- com.iizix.api.BaseEvent<UICOMP>
- com.iizix.api.ui.UIBaseEvent<UIComp>
- com.iizix.api.ui.UISelectionEvent
- All Implemented Interfaces:
IMessageBox
public class UISelectionEvent extends UIBaseEvent<UIComp>
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
Constructors Constructor Description UISelectionEvent(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IUIAnimatedSingleIndexedSelection
getAnimatedSingleIndexedSelection()
Gets the selection as an animated single indexed selection.IUIBooleanSelection
getBooleanSelection()
Gets the selection as a boolean selection.int
getCheckState()
Gets the check state.int
getFirstSelectedIndex()
Gets the first selected index.IUIIndexedSelection
getIndexedSelection()
Gets the selection as an indexed selection.int[]
getSelectedIndicies()
Gets the selected indicies, if the selection is index based.IUISelection
getSelection()
Gets the selection.IUISingleIndexedSelection
getSingleIndexedSelection()
Gets the selection as a single indexed selection.UIComp
getSource()
Gets the UI component that is the source of the event.GProp<?>
getTrigger()
Gets the trigger property being the source of the event.IUITriStateSelection
getTriStateSelection()
Gets the selection as a tri-state selection.boolean
isChecked()
Returns if the state is checked.boolean
isOFF()
Returns if the selection is "off".boolean
isON()
Returns if the selection is "on".boolean
isSelected()
Returns the selection state.boolean
isThirdState()
Returns if the state is third state, i.e.boolean
isUnselectedBoolean()
Returns if the boolean-based selection is not set.boolean
isUnselectedTriState()
Returns if the tri-state-based selection state is unselected.protected java.lang.String
paramString()
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
Constructor Detail
UISelectionEvent
public UISelectionEvent(UIComp source, IUISelection selection)
Constructs the event for a change without a trigger source.- Parameters:
source
- The source.selection
- The selection.- Throws:
java.lang.NullPointerException
- If the source or selection is null.
UISelectionEvent
public UISelectionEvent(UIComp source, IUISelection selection, GProp<?> trigger)
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:
java.lang.NullPointerException
- If the source or selection is null.
Method Detail
getTrigger
public GProp<?> 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
public UIComp getSource()
Gets the UI component that is the source of the event.
getSelection
public IUISelection 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
public IUIIndexedSelection getIndexedSelection()
Gets the selection as an indexed selection.- Returns:
- The selection instance, or null if the selection is not an indexed selection.
getSingleIndexedSelection
public IUISingleIndexedSelection 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
public IUIAnimatedSingleIndexedSelection 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
public IUIBooleanSelection 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
public IUITriStateSelection 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
protected java.lang.String paramString()
Gets the parameter string.- Overrides:
paramString
in classBaseEvent<UIComp>