Class MLGroup

All Implemented Interfaces:
IBackReferenceProvider, EventListener, IFocusComp, IMessageBox, IComponent, IContentProviderPropCnrAPI<MLItemProp,MLItem>, IClassReferenceOwner, ICustomDataProvider, IGProp<GProp<?>[]>, IPropCnr, IUIActionHolder, IUIComp, IUIContainer, IUIContextMenuOwner, IUIFocusComp, IUIIndexedSelectionComp, IUISelectionComp, IUISingleIndexedSelectionComp, IUIHTMLTextComponent, IUITextComponent, IVSColumnBestValueListener, IVSComponentListener, IVSComponentState, IVSFieldListener, IVSGenericComponentListener, IVSTableColumnReferenceOwner, IVSTableListener, Cloneable
Direct Known Subclasses:
EMLGroup

The mobile list item group contains mobile list items placed inserted into a list that comes from a VirtualSpace table or by means of the API. The group can have a heading.
Author:
Christopher Mindus
  • Constructor Details

    • MLGroup

      public MLGroup()
      Constructor of the container without name.
    • MLGroup

      public MLGroup(Atom atom)
      Constructor of the container.
      Parameters:
      atom - The name of this container.
  • Method Details

    • clone

      public MLGroup clone()
      Clones this instance.
      Overrides:
      clone in class AbstractContentUIContainer<MLItemProp,MLItem>
      Returns:
      The cloned container.
    • 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
    • isEmptyContainerAllowed

      public boolean isEmptyContainerAllowed()
      Returns whether the container should have children in a normal conditions, i.e. a warning message should be displayed in the Designer when it is empty. This is intended to be used to avoid use of empty containers.
      Overrides:
      isEmptyContainerAllowed in class AbstractContentUIContainer<MLItemProp,MLItem>
      Returns:
      true if the as the map container can do just fine without children.
    • createDefaultItemsStyles

      protected Styles createDefaultItemsStyles()
      Creates the Styles container for default items (must be overridden by Designer to create EditorStyles).
      Returns:
      A new EditorStyles container.
    • createDefaultDescriptionStyles

      protected Styles createDefaultDescriptionStyles()
      Creates the Styles container for descriptions of items (must be overridden by Designer to create EditorStyles).
      Returns:
      A new EditorStyles container.
    • createDefaultItemProp

      protected MLDefaultItemProp createDefaultItemProp()
      Creates the MLDefaultItemProp instance.
      Returns:
      A new MLDefaultItemProp instance.
    • getDefaultItemProp

      protected MLDefaultItemProp getDefaultItemProp()
      Returns the default item property instance.
    • addPredefinedProps

      protected void addPredefinedProps() throws PropException
      Adds the predefined properties for this container. This method is called once just after construction of the property container and sometimes population of it.

      The method should add properties to create or get reference to using the maybeAddProp method. When the PropCnr instance is cloned, the method getPredefinedProps() is called in order for the subclass to be able to retrieve the new instances to these properties, if stored in instance variables.

      Overrides:
      addPredefinedProps in class UIContainer
      Throws:
      PropException - for property exceptions.
    • getPredefinedProps

      public void getPredefinedProps()
      Gets the references to predefined properties. If the Styles is created, make sure to get it.
      Overrides:
      getPredefinedProps in class AbstractContentUIContainer<MLItemProp,MLItem>
    • getItemClass

      public Class<MLItemProp> getItemClass()
      Return the class of items stored in the container.
      Specified by:
      getItemClass in class AbstractContentUIContainer<MLItemProp,MLItem>
      Returns:
      The property container class for items.
    • getItemContentClass

      public Class<MLItem> getItemContentClass()
      Return the class of content items stored in the container.
      Specified by:
      getItemContentClass in class AbstractContentUIContainer<MLItemProp,MLItem>
      Returns:
      The property container class for content items.
    • createListItemProp

      protected MLItemProp createListItemProp(Atom atom)
      Creates a list item property.
      Parameters:
      atom - The name.
      Returns:
      The property.
    • createItem

      protected MLItemProp createItem(Atom atom, MLItem data)
      Creates a new property item from an item data holder and initializes the property.
      Specified by:
      createItem in class AbstractContentUIContainer<MLItemProp,MLItem>
      Parameters:
      atom - The name of the item property.
      data - The data to initialize the item property with.
      Returns:
      The item property.
    • createContentProvider

      protected IMListContentProvider createContentProvider()
      Creates the content provider.
      Overrides:
      createContentProvider in class AbstractContentUIContainer<MLItemProp,MLItem>
      Returns:
      The created content provider.
    • createDefaultContentProvider

      public MLContentProvider createDefaultContentProvider()
      Creates and returns a new instance of a default content provider.
      Specified by:
      createDefaultContentProvider in class AbstractContentUIContainer<MLItemProp,MLItem>
      Returns:
      The default content provider to use.
    • getContentTableColumnReferenceNames

      public Object[] getContentTableColumnReferenceNames()
      Gets the atoms of the references that are used to specify the VS column header connections for the VS table.
      Specified by:
      getContentTableColumnReferenceNames in class AbstractContentUIContainer<MLItemProp,MLItem>
      Returns:
      The array of atoms or Strings.
    • getBestVSColumnHeaderValueTypes

      public Value.Type[] getBestVSColumnHeaderValueTypes()
      Gets the value type that would best suit the for the columns.
      Specified by:
      getBestVSColumnHeaderValueTypes in class AbstractContentUIContainer<MLItemProp,MLItem>
      Returns:
      null if none is available.
    • isMobileContextMenuSupported

      public boolean isMobileContextMenuSupported()
      Returns if the component can show the context menu in mobile mode. The context menu is displayed for all list item in the group.
      Specified by:
      isMobileContextMenuSupported in interface IUIContextMenuOwner
      Overrides:
      isMobileContextMenuSupported in class UIContainer
      Returns:
      Always true for mobile support.
    • getContentProvider

      public IMListContentProvider getContentProvider()
      Gets the or created content provider to use.
      Overrides:
      getContentProvider in class AbstractContentUIContainer<MLItemProp,MLItem>
      Returns:
      A content provider, custom if defined and successfully created.
    • getVSColumnIndex

      protected int getVSColumnIndex(Object nameOrAtom)
      Gets the table column reference property with the String or Atom. This call makes it possible to redirect the reference into another container, e.g. for the MList default item. By default, the property is taken from this container.
      Overrides:
      getVSColumnIndex in class AbstractContentUIContainer<MLItemProp,MLItem>
      Parameters:
      nameOrAtom - The String name or Atom name.
      Returns:
      The VS table column index found, or -1 for none.
    • getIconProvider

      public IMListIconProvider getIconProvider()
      Gets the custom instance of the icon provider for the group.
      Returns:
      The instance, or null for none.
    • getClassReferenceAtom

      public Atom getClassReferenceAtom(String id)
      Gets the ClassReference atom name.
      Specified by:
      getClassReferenceAtom in interface IClassReferenceOwner
      Parameters:
      id - ID for the class reference if several exist, null for default.
      Returns:
      The class reference atom name for the ID.
    • getClassReference

      public ClassReference getClassReference(String id, boolean doCreateIfNotPresent)
      Gets or creates the ClassReference in the property container.
      Specified by:
      getClassReference in interface IClassReferenceOwner
      Parameters:
      id - ID for the class reference if several exist, null for default.
      doCreateIfNotPresent - Flag to create the property (this flag can only be true in Designer)!
      Returns:
      The resolved class reference instance, null if the ClassReference doesn't exist if the create flag is false. If flag is true, an orphan unresolved EditorClassReference instance (ONLY for the Designer).
    • isClassReferenceAnnotationBackReferenceRequired

      public boolean isClassReferenceAnnotationBackReferenceRequired(String id)
      Checks if the ClassReference require an annotation back-reference.
      Specified by:
      isClassReferenceAnnotationBackReferenceRequired in interface IClassReferenceOwner
      Parameters:
      id - ID for the class reference if several exist, null for default.
      Returns:
      true if the annotation is required to have a back-reference on the "ref" member value pair to the ClassReference owner.
    • getClassReferenceImplementsInterface

      public String getClassReferenceImplementsInterface(String id)
      Returns the required Interface.
      Specified by:
      getClassReferenceImplementsInterface in interface IClassReferenceOwner
      Parameters:
      id - ID for the class reference if several exist, null for default.
      Returns:
      The fully qualified name of the interface for the class, or null for none.
    • getClassReferenceRequiredAnnotation

      public String getClassReferenceRequiredAnnotation(String id)
      Returns the required annotation, or null for none.
      Specified by:
      getClassReferenceRequiredAnnotation in interface IClassReferenceOwner
      Parameters:
      id - ID for the class reference if several exist, null for default.
      Returns:
      The fully qualified name of the interface for the class, or null for none.
    • onItemAdded

      protected void onItemAdded(MLItemProp item)
      Item added event.

      Subclasses can implements its routine to initialize the required object that governs the API behavior of the property.

      Do not forget to FIRST call the super.onItemAdded(item) if overridden.

      Overrides:
      onItemAdded in class AbstractContentUIContainer<MLItemProp,MLItem>
      Parameters:
      item - The item added.
    • onItemRemoved

      protected void onItemRemoved(MLItemProp item)
      Item removed event.

      Subclasses can implements its routine to clean-up a potentially required object that governs the API behavior of the property.

      Do not forget to FIRST call the super.onItemRemoved(item) if overridden.

      Overrides:
      onItemRemoved in class AbstractContentUIContainer<MLItemProp,MLItem>
      Parameters:
      item - The item removed.
    • getHeadingText

      public KString getHeadingText()
      Gets the heading text.
      Returns:
      The text, or null if none is set.
    • getDefaultType

      public MLItemType getDefaultType()
      Gets the default type specified for the group.
      Returns:
      The list item type.