Interface DFContainer<E extends DFItem>


  • public interface DFContainer<E extends DFItem>
    Generic container for any DFItems list. Events should be fired as property changes on the owner DFItem. (e.g. DFEntity.PROP_FIELDS property change event in DFEntity when new field is added or some field is removed)
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      E findItemById​(java.lang.String id)
      Find item by its id (see DFItem.getId()).
      E findItemByName​(java.lang.String name)
      Find item by its name (see DFItem.getName()).
      java.util.List<java.lang.String> getAllItemIds()
      Get list of ids of all items contained by this DFContainer (see DFItem.getId()).
      java.util.List<E> getItems()
      Get list of all child items.
      java.util.List<DFNewType<E>> getNewTypes()
      Get the list of all available DFNewType.
      boolean isDeleteAllowed​(E itemToRemove)
      Test if the given item is allowed.
      void remove​(E itemToRemove, boolean destroyArtefacts, com.im.commons.progress.DFEnvironmentRW env)
      Removes the child item from the container (clear metadata) and destroy underlying artefacts if requested.
      void setItemsOrder​(java.util.List<? extends E> items, com.im.commons.progress.DFEnvironmentRW env)
      Change the order of child items according to items parameter
    • Method Detail

      • getNewTypes

        java.util.List<DFNewType<E>> getNewTypes()
        Get the list of all available DFNewType. New types are used for creating new items in this container. If you want to filter the returned new types, use convenience methods in DIFUtilities
      • isDeleteAllowed

        boolean isDeleteAllowed​(E itemToRemove)
        Test if the given item is allowed.
      • remove

        void remove​(E itemToRemove,
                    boolean destroyArtefacts,
                    com.im.commons.progress.DFEnvironmentRW env)
        Removes the child item from the container (clear metadata) and destroy underlying artefacts if requested. Underlying artefacts are usually relational database elements like tables, columns, foreign keys, etc.
        Parameters:
        itemToRemove - The item to be removed
        destroyArtefacts - If true, underlying (e.g. database) objects are destroyed. Some DFItems are metadata only (virtual) and do not have any underlying artefacts so then this argument has no meaning in this case (e.g. DFDataTree has no peer in the database world; the same for the views).
      • getAllItemIds

        java.util.List<java.lang.String> getAllItemIds()
        Get list of ids of all items contained by this DFContainer (see DFItem.getId()).
      • findItemById

        E findItemById​(java.lang.String id)
        Find item by its id (see DFItem.getId()).
        Parameters:
        id - The ID of the item to find
        Returns:
        The item, or null if not present
      • findItemByName

        E findItemByName​(java.lang.String name)
        Find item by its name (see DFItem.getName()). If there are multiple items with the same name, one of them will be returned. Ideally, the name should be unique for each item in a DFContainer, but this is not guaranteed by the DB layer.
        Parameters:
        name - The name of the item to find
        Returns:
        The item, or null if not present
        Since:
        15.2.2
      • getItems

        java.util.List<E> getItems()
        Get list of all child items.
      • setItemsOrder

        void setItemsOrder​(java.util.List<? extends E> items,
                           com.im.commons.progress.DFEnvironmentRW env)
        Change the order of child items according to items parameter
        Parameters:
        items - items in required order
        env - environment
        Since:
        6.3