Class FormElementSearchEngine

  • All Implemented Interfaces:

    public class FormElementSearchEngine
    extends Object
    implements org.eclipse.emf.edit.provider.IDisposable
    Represents an engine to search the elements of form.
    • Constructor Detail

      • FormElementSearchEngine

        public FormElementSearchEngine​(Comparator<PropertyInfo> attributesComparator)
        Initializes a new instance of class.
        attributesComparator - the attributes comparator, can not be null.
    • Method Detail

      • init

        public void init​(MappingController mappingController,
                         Consumer<Object> foundElementConsumer)
        Full initialization of engine.
        mappingController - the mapping controller, can not be null.
        foundElementConsumer - consumer of found element, can not be null.
      • getFilterData

        public FilterData getFilterData()
        Gets current filter data.
        curent filter data, never null.
      • setFilterData

        public void setFilterData​(FilterData filterData)
        Sets new filter data. The search will be repositioned to the begining if the filter data was changed.
        filterData - the new filter data, can not be null.
      • performSearchFromTheBegining

        public void performSearchFromTheBegining()
        Performs searching from the begining.
      • canSearch

        public boolean canSearch()
        Gets a value indicating whether the searching can be executed.
        true if this engine was initialized and the filter was set from non-empty data; otherwise, false.
      • search

        public Object search​(boolean backwardDirection)
        Forward or backward searching.
        backwardDirection - the backward direction.
        Found element of form.
        After seach was happend then method delegates found object (or null if found nothing) to the consumer that was specified in #init(List, Consumer). Execution will back to this method after the consumer work has done.
        See Also:
      • repositionSearchTo

        public void repositionSearchTo​(Object targetElement)
        Repositions searching to specific element. Automatically switches to the concrete searcher and sets the current filter data for it.
        targetElement - the element to which to reposition.
      • refreshInputByElementType

        public void refreshInputByElementType​(Class<?> elementType)

        Refreshes the input by element type:

      • FormMapping, Item for items searcher.
      • PropertyInfo for attributes searcher.
elementType - the element type to refresh concrete searcher input.
elementType - the element type to switch searcher.