Class EventBuilder

java.lang.Object
com.jbstrap.core.event.EventBuilder

public final class EventBuilder extends Object

Event builder class

If we want to trigger the event through code, without user input then the event must be built in the code. In this case, the event will only contain data, that is specified during the creation of the event.

Since:
4.0
Author:
JBStrap
  • Method Details

    • createFormChangeEvent

      public static EventBuilder createFormChangeEvent()
      Creates a new event builder class, that will trigger a form change event
      Returns:
      The event builder class
    • createFilterBarFilteringEvent

      public static EventBuilder createFilterBarFilteringEvent(Criteria criteria)
      Creates a new event builder class, that will trigger a filter bar filtering event
      Returns:
      The event builder class
    • createFormItemChangeEvent

      public static EventBuilder createFormItemChangeEvent()
      Creates a new event builder class, that will trigger a form item change event
      Returns:
      The event builder class
    • createBrowserEvent

      public static EventBuilder createBrowserEvent(EventType eventType)
      Creates a new event builder class, that will trigger a browser event
      Parameters:
      eventType - The event type that will be triggered. The types can be found in the EventType enum
      Returns:
      The event builder class
    • createErrorEvent

      public static EventBuilder createErrorEvent(String errorMessage)
      Creates a new error event builder class
      Parameters:
      errorMessage - The error message that will be given to the error event
      Returns:
      The event builder class
    • createFetchDoneEvent

      public static EventBuilder createFetchDoneEvent(Throwable e)
      Creates a new fetch done event builder class
      Parameters:
      e - The error class, encountered during the query, or null, if the query was successful
      Returns:
      The event builder class
    • set

      public EventBuilder set(String fieldName, Object value)
      Sets the data of the event that is to be triggered.
      Parameters:
      fieldName - The event data field name
      value - The event data value
      Returns:
      The event builder class
    • fireEvent

      public void fireEvent(Component<?> component)
      Fires the built event on the specified component.
      Parameters:
      component - The component where the event is to be fired
      Throws:
      NullPointerException - If the specified component is null