ui/uinodecollection

class UINodeCollection()
Extends:UINode

Designed to hold UINode() s.

Warning

This is only a skeleton class. It is not to be instanciated!

attach(instance)

Attach instance to internal instance array.

Warning

This method does only implement some checks and does detach the instance if it is already attached.

Arguments:
  • instance (UINode) – The instance to attach.
  • leftOf (UINode|Number) – The instance to attach will be left of this instance or the instance at this postion.
  • rightOf (UINode|Number) – If leftOf is undefined then this option is considered. The instance to attach will be right of this instance or the instance at this postion.
Returns:

The postion the instance will be placed at.

Return type:

Number

Note

Both, leftOf and rightOf are interpreted this way:
  • If it isn’t a Number then interpret the argument as an instance. If it isn’t an valid instance either, just default to the postion at the very end.
  • If it is a Number then interpret it as position in the list of instance, with 0 being the first. If it is negative then use it as an offst from the end. e.g. -2 is the second last position (clipped at the first position)
replace(oldInstance, newInstance)

Replaces a currently attached instance with another one.

Warning

This method does only implement some checks und does detach the newInstance if it is already attached

Arguments:
  • oldInstance (UINode) – Instance to replace.
  • newInstance (UINode) – Instance to take the place.
Returns:

Index of the instance to replace in the internal instance array.

Return type:

Number

detach(instance)

Detaches a currently attached instance.

Warning

This method does not implement anyting, it is to be extended.

Arguments:
  • instance (UINode) – Instance to detach.
detachAll()

Detaches all instance (one by one).

Returns:Count of instances detached.
Return type:Number
length
Type:Integer

The number of current instances this collection has.

class-membervalidInstanceClass
Value:UINode

Only instances of this Class will be accepted by attach() and replace(). Classes extending UINodeCollection() are expected to define it appropriately.