Package com.iizix.prop.ui.selection
Class SingleIndexSelection
- java.lang.Object
- com.iizix.prop.ui.selection.SingleIndexSelection
- All Implemented Interfaces:
IUIIndexedSelection
,IUISelection
,IUISingleIndexedSelection
- Direct Known Subclasses:
AnimatedSingleIndexSelection
public class SingleIndexSelection extends java.lang.Object implements IUISingleIndexedSelection
The single index-based selection state used by e.g. comboboxes.- Author:
- Christopher Mindus
Field Summary
Fields inherited from interface com.iizix.prop.ui.selection.IUISingleIndexedSelection
EMPTY
Constructor Summary
Constructors Constructor Description SingleIndexSelection(IUISingleIndexedSelectionComp source, int selectedIndex)
Constructor.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
Equals.IUISingleIndexedSelectionComp
getIndexedSource()
Get the source component of the event.int
getSelectedIndex()
Gets the first selected index.int[]
getSelectedIndicies()
Gets the selected indicies.IUISingleIndexedSelectionComp
getSingleIndexedSource()
Get the source component of the event.IUISingleIndexedSelectionComp
getSource()
Get the source component of the event.UIComp
getUISource()
Gets the UI component being the source of the event.java.lang.String
toString()
Converts the selection to a string.Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.iizix.prop.ui.selection.IUISelection
asAnimatedSingleIndexedSelection, asBooleanSelection, asCellSelection, asIndexedSelection, asSingleIndexedSelection, asTriStateSelection
Methods inherited from interface com.iizix.prop.ui.selection.IUISingleIndexedSelection
getFirstSelectedIndex
Constructor Detail
SingleIndexSelection
public SingleIndexSelection(IUISingleIndexedSelectionComp source, int selectedIndex)
Constructor.- Parameters:
source
- The component source.selectedIndex
- The selected index, or -1 for none.
Method Detail
getSource
public IUISingleIndexedSelectionComp getSource()
Get the source component of the event.- Specified by:
getSource
in interfaceIUISelection
- Returns:
- The source.
getUISource
public UIComp getUISource()
Gets the UI component being the source of the event.- Specified by:
getUISource
in interfaceIUISelection
- Returns:
- The UI component.
getSelectedIndex
public int getSelectedIndex()
Gets the first selected index.- Specified by:
getSelectedIndex
in interfaceIUISingleIndexedSelection
- Returns:
- The first index in the current selection, or -1 for none.
getSelectedIndicies
public int[] getSelectedIndicies()
Gets the selected indicies.- Specified by:
getSelectedIndicies
in interfaceIUIIndexedSelection
- Specified by:
getSelectedIndicies
in interfaceIUISingleIndexedSelection
- 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.
getIndexedSource
public IUISingleIndexedSelectionComp getIndexedSource()
Get the source component of the event.- Specified by:
getIndexedSource
in interfaceIUIIndexedSelection
- Specified by:
getIndexedSource
in interfaceIUISingleIndexedSelection
- Returns:
- The indexed-type component.
getSingleIndexedSource
public IUISingleIndexedSelectionComp getSingleIndexedSource()
Get the source component of the event.- Specified by:
getSingleIndexedSource
in interfaceIUISingleIndexedSelection
- Returns:
- The single-indexed-type component.
equals
public boolean equals(java.lang.Object o)
Equals.- Overrides:
equals
in classjava.lang.Object
toString
public java.lang.String toString()
Converts the selection to a string.- Overrides:
toString
in classjava.lang.Object