Interface ICodeItemArrayContainer
- All Superinterfaces:
IKStringArrayContainer
,IStringArrayContainer
- All Known Implementing Classes:
CodeItemArrayProp
,EUIComboBox
,EUISpinner
,UIAbstractListChoice
,UIComboBox
,UISpinner
- Author:
- Christopher Mindus
Method Summary
Modifier and TypeMethodDescriptiondefault void
Adds a new item.default void
Adds a new item.default void
Adds a new item.default void
Adds a new items.default void
addItems
(Collection<ICodeItem> items) Adds a new items.default ICodeItemArrayContainer
Gets the target implementor of the interface.default ICodeItem
getItem
(int index) Gets the item at the specified index as a KString.default int
Gets the item count.default int
getItemIndex
(ICodeItem item) Gets the index of of item.default KString
getItemKString
(int index) Gets the item at the specified index as a KString.default ICodeItem[]
getItems()
Gets the array of items.default String
getItemString
(int index) Gets the item at the specified index as a String.default void
insertItem
(ICodeItem item, int index) Inserts an item at specified index.default void
insertItem
(KString item, int index) Inserts an item at specified index.default void
insertItem
(String item, int index) Inserts an item at specified index.default void
Removes all items.default void
removeAllItems
(boolean keepSelection) Removes all items but keeps the selection depending on the flag.default ICodeItem
removeItem
(int index) Removes an item.default int
removeItem
(ICodeItem item) Removes an item.default ICodeItem
Sets an item at specified index.default KString
Sets an item at specified index.default String
Sets an item at specified index.default void
Sorts the list according to the default JVM locale case sensitively.default void
sortItems
(boolean isCaseInsensitive) Sorts the list according to the default JVM locale.default void
Sorts the list according to a locale case sensitively.default void
Sorts the list according to a locale.Methods inherited from interface com.iizix.prop.IKStringArrayContainer
addItems, getItemsAsKStrings, getKStringArrayContainer, isHTMLKStringSupported, removeItem
Methods inherited from interface com.iizix.prop.IStringArrayContainer
addItems, getItemsAsStrings, getStringArrayContainer, removeItem
Method Details
getCodeArrayArrayContainer
Gets the target implementor of the interface.- Returns:
- The target implements of the interface, null for none (this instance).
getItems
Gets the array of items.- Returns:
- An array of code items.
getItem
Gets the item at the specified index as a KString.- Parameters:
index
- The index.- Returns:
- The KString item.
- Throws:
IndexOutOfBoundsException
- If the index is invalid.
getItemIndex
Gets the index of of item.- Parameters:
item
- The item.- Returns:
- The index of the item, or -1 if not found or item is null.
getItemString
Gets the item at the specified index as a String.- Specified by:
getItemString
in interfaceIStringArrayContainer
- Parameters:
index
- The index.- Returns:
- The String item.
- Throws:
IndexOutOfBoundsException
- If the index is invalid.
getItemKString
Gets the item at the specified index as a KString.- Specified by:
getItemKString
in interfaceIKStringArrayContainer
- Parameters:
index
- The index.- Returns:
- The KString item.
- Throws:
IndexOutOfBoundsException
- If the index is invalid.
getItemCount
default int getItemCount()Gets the item count.- Specified by:
getItemCount
in interfaceIKStringArrayContainer
- Specified by:
getItemCount
in interfaceIStringArrayContainer
- Returns:
- The count of items.
sortItems
default void sortItems()Sorts the list according to the default JVM locale case sensitively.The selected index may change as a result of the sorting if selection is supported.
- Specified by:
sortItems
in interfaceIKStringArrayContainer
- Specified by:
sortItems
in interfaceIStringArrayContainer
- Throws:
IllegalStateException
- If the container is read-only.
sortItems
default void sortItems(boolean isCaseInsensitive) Sorts the list according to the default JVM locale.The selected index may change as a result of the sorting if selection is supported.
- Specified by:
sortItems
in interfaceIKStringArrayContainer
- Specified by:
sortItems
in interfaceIStringArrayContainer
- Parameters:
isCaseInsensitive
- Flag for case insensitive.- Throws:
IllegalStateException
- If the container is read-only.
sortItems
Sorts the list according to a locale case sensitively.The selected index may change as a result of the sorting if selection is supported.
- Specified by:
sortItems
in interfaceIKStringArrayContainer
- Specified by:
sortItems
in interfaceIStringArrayContainer
- Parameters:
locale
- The locale to use for string sorting.- Throws:
IllegalStateException
- If the container is read-only.
sortItems
Sorts the list according to a locale.The selected index may change as a result of the sorting if selection is supported.
- Specified by:
sortItems
in interfaceIKStringArrayContainer
- Specified by:
sortItems
in interfaceIStringArrayContainer
- Parameters:
locale
- The locale to use for string sorting, null for default..isCaseInsensitive
- Flag for case insensitive.- Throws:
IllegalStateException
- If the container is read-only.
addItem
Adds a new item.- Parameters:
item
- The item to add.- Throws:
NullPointerException
- If the item is null.IllegalStateException
- If the container is read-only.
addItem
Adds a new item.- Specified by:
addItem
in interfaceIStringArrayContainer
- Parameters:
item
- The item to add.- Throws:
NullPointerException
- If the item is null.IllegalStateException
- If the container is read-only.
addItem
Adds a new item.- Specified by:
addItem
in interfaceIKStringArrayContainer
- Parameters:
item
- The item to add.- Throws:
NullPointerException
- If the item is null.IllegalStateException
- If the container is read-only.
addItems
Adds a new items.- Parameters:
items
- The items to add.- Throws:
NullPointerException
- If an item is null.IllegalStateException
- If the container is read-only.
addItems
Adds a new items.- Parameters:
items
- The items to add.- Throws:
NullPointerException
- If an item is null.IllegalStateException
- If the container is read-only.
insertItem
Inserts an item at specified index.The selection may be changed due to this operation if the owner support selection.
- Parameters:
item
- The item to add.index
- The index to insert the item before (-1 for last).- Throws:
NullPointerException
- If the item is null.IndexOutOfBoundsException
- If the index is in error.IllegalStateException
- If the container is read-only.
insertItem
Inserts an item at specified index.The selection may be changed due to this operation if the owner support selection.
- Specified by:
insertItem
in interfaceIStringArrayContainer
- Parameters:
item
- The item to add.index
- The index to insert the item before (-1 for last).- Throws:
NullPointerException
- If the item is null.IndexOutOfBoundsException
- If the index is in error.IllegalStateException
- If the container is read-only.
insertItem
Inserts an item at specified index.The selection may be changed due to this operation if the owner support selection.
- Specified by:
insertItem
in interfaceIKStringArrayContainer
- Parameters:
item
- The item to add.index
- The index to insert the item before (-1 for last).- Throws:
NullPointerException
- If the item is null.IndexOutOfBoundsException
- If the index is in error.IllegalStateException
- If the container is read-only.
setItem
Sets an item at specified index.- Parameters:
item
- The item to set.index
- The index of the item.- Returns:
- The old item.
- Throws:
NullPointerException
- If the item is null.IndexOutOfBoundsException
- If the index is in error.IllegalStateException
- If the container is read-only.
setItem
Sets an item at specified index.- Specified by:
setItem
in interfaceIStringArrayContainer
- Parameters:
item
- The item to set.index
- The index of the item.- Returns:
- The old item.
- Throws:
NullPointerException
- If the item is null.IndexOutOfBoundsException
- If the index is in error.IllegalStateException
- If the container is read-only.
setItem
Sets an item at specified index.- Specified by:
setItem
in interfaceIKStringArrayContainer
- Parameters:
item
- The item to set.index
- The index of the item.- Returns:
- The old item.
- Throws:
NullPointerException
- If the item is null.IndexOutOfBoundsException
- If the index is in error.IllegalStateException
- If the container is read-only.
removeItem
Removes an item.The selection may be changed due to this operation if the owner support selection.
- Specified by:
removeItem
in interfaceIKStringArrayContainer
- Specified by:
removeItem
in interfaceIStringArrayContainer
- Parameters:
index
- The index of the item to delete.- Returns:
- The item deleted.
- Throws:
IndexOutOfBoundsException
- If the index is in error.IllegalStateException
- If the container is read-only.
removeItem
Removes an item.The selection may be changed due to this operation if the owner support selection.
- Parameters:
item
- The item to remove.- Returns:
- The index of the item removed, -1 if not found.
- Throws:
IndexOutOfBoundsException
- If the index is in error.IllegalStateException
- If the container is read-only.
removeAllItems
default void removeAllItems()Removes all items.The selection may be changed (cleared) due to this operation if the owner support selection.
- Specified by:
removeAllItems
in interfaceIKStringArrayContainer
- Specified by:
removeAllItems
in interfaceIStringArrayContainer
- Throws:
IllegalStateException
- If the container is read-only.
removeAllItems
default void removeAllItems(boolean keepSelection) Removes all items but keeps the selection depending on the flag.The selection may be changed (cleared) due to this operation if the owner support selection.
- Specified by:
removeAllItems
in interfaceIKStringArrayContainer
- Specified by:
removeAllItems
in interfaceIStringArrayContainer
- Parameters:
keepSelection
- The boolean to keep the selection.- Throws:
IllegalStateException
- If the container is read-only.