AbstractGets the event that is fired when the component's focus-state is changing.
Gets the event that is fired when the component's hover-state is changing.
Gets the event that is fired when an item is added to the list of items.
Gets the event that is fired when an item is removed from the list of items.
Gets the event that is fired when an item is selected from the list of items.
Gets the event that is fired when the ViewMode of this component has changed.
Adds an item to this selector by doing a sorted insert or by appending the element to the end of the list of items. If an item with the specified key already exists, it is replaced.
the key of the item to add
the (human-readable) label of the item to add
whether the item should be added respecting the order of keys
custom aria label for the listItem
Removes all items from this selector.
Configures the component for the supplied Player and UIInstanceManager. This is the place where all the magic happens, where components typically subscribe and react to events (on their DOM element, the Player, or the UIInstanceManager), and basically everything that makes them interactive. This method is called only once, when the UIManager initializes the UI.
Subclasses usually overwrite this method to add their own functionality.
the player which this component controls
the UIInstanceManager that manages this component
Disables the component. This method basically transfers the component into the disabled state. Actual disabling is done via CSS or child components. (e.g. Button needs to unsubscribe click listeners)
Enables the component. This method basically transfers the component into the enabled state. Actual enabling is done via CSS or child components. (e.g. Button needs to subscribe click listeners)
Returns the configuration object of the component.
Returns the DOM element of this component. Creates the DOM element if it does not yet exist.
Should not be overwritten by subclasses.
Returns the items for the given key or undefined if no item with the given key exists.
the key of the item to return
the item with the requested key. Undefined if no item with the given key exists.
Returns all current items of this selector. *
Returns the key of the selected item.
the key of the selected item or null if no item is selected
Checks if this component has a DOM element.
Checks if the specified item is part of this selector.
the key of the item to check
true if the item is part of this selector, else false
Hides the component if shown. This method basically transfers the component into the hidden state. Actual hiding is done via CSS.
Initializes the component, e.g. by applying config settings. This method must not be called from outside the UI framework.
This method is automatically called by the UIInstanceManager. If the component is an inner component of some component, and thus encapsulated abd managed internally and never directly exposed to the UIManager, this method must be called from the managing component's #initialize method.
Determines if the component is disabled.
true if the component is disabled, else false
Determines if the component is enabled.
true if the component is enabled, else false
Determines if the component is hidden.
true if the component is hidden, else false
Determines if the component is currently hovered.
true if the component is hovered, else false
Determines if the component is shown.
true if the component is visible, else false
Returns the number of items in this selector.
Releases all resources and dependencies that the component holds. Player, DOM, and UIManager events are automatically removed during release and do not explicitly need to be removed here. This method is called by the UIManager when it releases the UI.
Subclasses that need to release resources should override this method and call super.release().
Removes an item from this selector.
the key of the item to remove
true if removal was successful, false if the item is not part of this selector
Selects an item from the items in this selector.
the key of the item to select
true is the selection was successful, false if the selected item is not part of the selector
Shows the component if hidden.
Synchronize the current items of this selector with the given ones. This will remove and add items selectively. For each removed item the ItemRemovedEvent and for each added item the ItemAddedEvent will be triggered. Favour this method over using clearItems and adding all items again afterwards.
Toggles the hidden state by hiding the component if it is shown, or showing it if hidden.
The base class of the UI framework. Each component must extend this class and optionally the config interface.