Class FormItemAssociationService


  • public class FormItemAssociationService
    extends Object
    The service for search an related form items by various object (Command, AbstractDataPath and etc.)
    • Constructor Detail

      • FormItemAssociationService

        public FormItemAssociationService()
    • Method Detail

      • findRelated

        public Set<Button> findRelated​(FormItemContainer container,
                                       Command command)
        The method looks for buttons that corresponding with Command. The searching starts from container item.
        Parameters:
        container - the root element,with which search begins
        command - the command for which are looked for related button
        Returns:
        the related form buttons. Returns empty Set if related button not exists.
        Throws:
        NullPointerException - if container or command is null
      • findRelated

        public Set<Button> findRelated​(FormItemContainer container,
                                       Command command,
                                       AbstractDataPath path)
        The method looks for buttons that corresponding with Command and AbstractDataPath. The searching starts from container item.
        Parameters:
        container - the root element,with which search begins
        command - it is one of paths on which are looked the related buttons
        path - it is one of paths on which are looked the related buttons
        Returns:
        the related form buttons. Returns empty Set if related button not exists.
        Throws:
        NullPointerException - if container or command is null
      • findFirstRelated

        public Button findFirstRelated​(FormItemContainer container,
                                       Command command)
        The method returns first related button with current Command. The searching starts from container item.
        Parameters:
        container - the root element,with which search begins
        command - the command for which are looked for related button
        Returns:
        the related form button. Returns null if related button not exists.
        Throws:
        NullPointerException - if container or command is null
      • findFirstRelated

        public Button findFirstRelated​(FormItemContainer container,
                                       Command command,
                                       AbstractDataPath path)
        The method looks for button that corresponding with Command and AbstractDataPath. The searching starts from container item.
        Parameters:
        container - the root element,with which search begins
        command - it is one of paths on which are looked the related buttons
        path - it is one of paths on which are looked the related buttons
        first - is flag for returns first only one related button
        Returns:
        the related form button. Returns null if related button not exists.
        Throws:
        NullPointerException - if container or command is null
      • findRelated

        public <T extends DataItemSet<T> findRelated​(FormItemContainer container,
                                                       PropertyInfo property,
                                                       boolean first,
                                                       Class<T> clazz)
        The method looks for DataItem that corresponding with AbstractDataPath. The searching starts from container item.
        Parameters:
        container - the root element,with which search begins
        property - it is PropertyInfo corresponding to the one of paths on which are looked the related DataItem
        first - is flag for returns first only one related button
        clazz - the DataItem class, can't be null
        Returns:
        the related form DataItem, can be null if DataItem wasn't found
      • findRelated

        protected Set<Button> findRelated​(FormItemContainer container,
                                          Command command,
                                          AbstractDataPath path,
                                          boolean first)
        The method looks for buttons that corresponding with Command and AbstractDataPath. The searching starts from container item.
        Parameters:
        container - the root element,with which search begins
        command - it is one of paths on which are looked the related buttons
        path - it is one of paths on which are looked the related buttons
        first - is flag for returns first only one related button
        Returns:
        the related form button
        Throws:
        NullPointerException - if container or command is null
      • findRelated

        protected <T extends DataItemSet<T> findRelated​(FormItemContainer container,
                                                          AbstractDataPath path,
                                                          Class<T> clazz,
                                                          boolean first)
        The method looks for DataItem that corresponding with AbstractDataPath. The searching starts from container item.
        Parameters:
        container - the root element,with which search begins
        command - it is one of paths on which are looked the related buttons
        path - it is one of paths on which are looked the related buttons
        clazz - the DataItem class, can't be null
        Returns:
        the related form DataItems, can't be null