Class MList

All Implemented Interfaces:
EventListener, IFocusComp, IMessageBox, IComponent, ICustomDataProvider, IGProp<GProp<?>[]>, IPropCnr, IUIComp, IUIContainer, IUIContextMenuOwner, IUIFocusComp, IVSComponentListener, IVSComponentState, IVSFieldListener, IVSGenericComponentListener, Cloneable
Direct Known Subclasses:
EMList

public class MList extends UIContainer
Mobile list item UI component.
Author:
Christopher Mindus
  • Constructor Details

    • MList

      public MList()
      Creates the container without name with a null value.
    • MList

      public MList(Atom propertyAtom)
      Creates the container with the specified name with a null value.
      Parameters:
      propertyAtom - the property atom.
    • MList

      public MList(Atom propertyAtom, GProp<?>[] properties) throws PropException
      Creates the container with the specified name and properties.
      Parameters:
      propertyAtom - the property atom.
      properties - the property array value for the container.
      Throws:
      PropException - when properties are not correctly defined.
  • Method Details

    • getDeviceType

      public final int getDeviceType()
      Gets the device type: -1=mobile, 0=both, 1=desktop.
      Specified by:
      getDeviceType in interface IUIComp
      Overrides:
      getDeviceType in class UIContainer
    • clone

      public MList clone()
      Clones the list.
      Overrides:
      clone in class UIContainer
    • getApproximateSize

      public Size getApproximateSize()
      Returns the size of the component in pixels. The size is a calculation and does not exactly reflect the real size that may be different due to additional styles not taken into account by this method. The size is calculated from the font of the component and default or defined values (such as character length or number of lines for text area).
      Overrides:
      getApproximateSize in class UIContainer
      Returns:
      The size of the component: 0x0 (none).
    • getFirstGroupNull

      public MLGroup getFirstGroupNull()
      Gets the first group of list items.
      Returns:
      The list item group, or null if not found.
    • getFirstGroup

      public MLGroup getFirstGroup() throws NotFoundException
      Gets the first group of list items.
      Returns:
      The list item group, never null.
      Throws:
      NotFoundException - If the first list item group is not found.
    • getGroupNull

      public MLGroup getGroupNull(String name)
      Gets a group of list items by name.
      Parameters:
      name - The name of the group.
      Returns:
      The list item group, or null if not found.
    • getGroup

      public MLGroup getGroup(String name) throws NotFoundException
      Gets a group of list items by name.
      Parameters:
      name - The name of the group.
      Returns:
      The list item group, never null.
      Throws:
      NotFoundException - If the list item group is not found.
    • add

      public void add(MLItem item) throws NotFoundException
      Adds a new item last in the first group.

      Note: This method is a convenience access method, and for best performance, use the API methods from the MLGroup class. Retrieve the group with getFirstGroup().

      Parameters:
      item - The item to insert.
      Throws:
      NotFoundException - If the first list item group is not found.
      IllegalStateException - When the VirtualSpace is connected and changes must be done from there and not by means of API functions.
    • add

      public void add(int index, MLItem item) throws NotFoundException
      Inserts a new item before the specified index in the first group.

      Note: This method is a convenience access method, and for best performance, use the API methods from the MLGroup class. Retrieve the group with getFirstGroup().

      Parameters:
      index - The insertion point index, -1 for last.
      item - The item to insert.
      Throws:
      NotFoundException - If the first list item group is not found.
      IndexOutOfBoundsException - If the index is not valid.
      IllegalStateException - When the VirtualSpace is connected and changes must be done from there and not by means of API functions.
    • remove

      public MLItem remove(int index) throws NotFoundException
      Removes an item at the specified index from the first group.

      Note: This method is a convenience access method, and for best performance, use the API methods from the MLGroup class. Retrieve the group with getFirstGroup().

      Parameters:
      index - The item to remove.
      Returns:
      The removed item.
      Throws:
      NotFoundException - If the first list item group is not found.
      IndexOutOfBoundsException - If the index is not valid.
      IllegalStateException - When the VirtualSpace is connected and changes must be done from there and not by means of API functions.
    • remove

      public boolean remove(MLItem item) throws NotFoundException
      Removes an item from the first group.

      Note: This method is a convenience access method, and for best performance, use the API methods from the MLGroup class. Retrieve the group with getFirstGroup().

      Parameters:
      item - The item to remove.
      Returns:
      true for success, false if not found.
      Throws:
      NotFoundException - If the first list item group is not found.
      IllegalStateException - When the VirtualSpace is connected and changes must be done from there and not by means of API functions.
    • removeAll

      public boolean removeAll() throws NotFoundException
      Removes all items from the first group.

      Note: This method is a convenience access method, and for best performance, use the API methods from the MLGroup class. Retrieve the group with getFirstGroup().

      Returns:
      true for changed, false when no items were present.
      Throws:
      NotFoundException - If the first list item group is not found.
      IllegalStateException - When the VirtualSpace is connected and changes must be done from there and not by means of API functions.
    • getItemCount

      public int getItemCount() throws NotFoundException
      Returns the list item count in the first group.

      Note: This method is a convenience access method, and for best performance, use the API methods from the MLGroup class. Retrieve the group with getFirstGroup().

      Returns:
      The current count of items.
      Throws:
      NotFoundException - If the first list item group is not found.
    • get

      public MLItem get(int index) throws NotFoundException
      Removes an item at the specified index from the first group.

      Note: This method is a convenience access method, and for best performance, use the API methods from the MLGroup class. Retrieve the group with getFirstGroup().

      Parameters:
      index - The item to remove.
      Returns:
      The removed item.
      Throws:
      NotFoundException - If the first list item group is not found.
      IndexOutOfBoundsException - If the index is not valid.
      IllegalStateException - When the VirtualSpace is connected and changes must be done from there and not by means of API functions.
    • getAll

      public MLItem[] getAll() throws NotFoundException
      Gets all the list items from the first group.

      Note: This method is a convenience access method, and for best performance, use the API methods from the MLGroup class. Retrieve the group with getFirstGroup().

      Returns:
      The array of list items.
      Throws:
      NotFoundException - If the first list item group is not found.
    • getActionItem

      public MLItemProp getActionItem()
      Returns the action that last triggered the OnUIAction, VSAction or VS focus.
      Returns:
      The List Item, null for none.