Class BaseFilter<T extends Component<?>>

java.lang.Object
com.jbstrap.core.messagebus.MessageBus
com.jbstrap.ui.Component<T>
com.jbstrap.ui.components.filter.BaseFilter<T>
Direct Known Subclasses:
JBBaseFilter

public abstract class BaseFilter<T extends Component<?>> extends Component<T>
  • Field Details

  • Constructor Details

  • Method Details

    • getType

      public FilterType getType()
      Gets filter type
      Returns:
      The filter type
    • setFiltering

      public T setFiltering(FilterBarFiltering<?> filtering)
      Sets the filterable component as the filter component. The filter component does not automatically call the filter method, no additional source code is needed.
      Parameters:
      filtering - Filterable component instance If null is specified, the filter component does not automatically filter
      Returns:
      Filter component
    • getFiltering

      public FilterBarFiltering<?> getFiltering()
      Gets the filterable component set as filter component.
      Returns:
      Filterable component or null if not set
    • setDataDescriptor

      public T setDataDescriptor(DataDescriptor dataDescriptor)
      Builds the filter component according to the provided DataDescriptor. The method adds all the columns in the specified DataDescriptor where the filter is enabled and also passes the parameters to these columns.
      Parameters:
      dataDescriptor - The DataDescriptor instance used for building the filter component
      Returns:
      The filter component
      See Also:
    • getDataDescriptor

      public DataDescriptor getDataDescriptor()
      Gets the DataDescriptor set as filter component.
      Returns:
      DataDescriptor set as filter component
    • getCriteria

      public abstract Criteria getCriteria()
    • reset

      public abstract T reset()
      Removes all filter conditions from the filter component and setting the filter component to default
      Returns:
      The filter component
    • writeHTML

      public boolean writeHTML(StringWriter writer)
      Description copied from class: Component
      Creates the component's HTML equivalent

      This method doesn't need to be used during application development. This method is used when developing a custom component. When creating a custom component, this method needs to be implemented. In the parameter (StringWriter class) the component's HTML equivalent must be specified, and the method has to return with a Boolean value. This boolean value determines if the component was drawn. If the user doesn't have access right to the component, or if the component couldn't be drawn, it should return with false. Otherwise, it must return with true.

      Specified by:
      writeHTML in class Component<T extends Component<?>>
      Returns:
      If the componentwas drawn, true, otherwise false
    • setCriteria

      public abstract T setCriteria(Criteria criteria)
    • runAfterDrawOnEditor

      protected final void runAfterDrawOnEditor(Component<?> editor)
      Parameters:
      editor - The editor component
    • runOnShowOnEdior

      protected final void runOnShowOnEdior(Component<?> editor)
      Parameters:
      editor - The editor component
    • runOnHideOnEditor

      protected final void runOnHideOnEditor(Component<?> editor)
      Parameters:
      editor - The editor component
    • getComponents

      public List<Component<?>> getComponents()
      Description copied from class: Component
      Gets every previously added subcomponent
      Overrides:
      getComponents in class Component<T extends Component<?>>
      Returns:
      A collection of every subcomponent that was added to the component. If there are none, the collection will be empty
    • onHide

      public void onHide()
      Description copied from class: Component
      The operations to be executed after the component is hidden on the client

      By default, this is an empty method. It has to be overwritten on a component or page, if additional operations have to be executed after the component is hidden.

      Overrides:
      onHide in class Component<T extends Component<?>>