Class CloseModalEvent

java.lang.Object
no.ntnu.principes.event.PrincipesEvent<ModalResult>
no.ntnu.principes.event.navigation.CloseModalEvent

public class CloseModalEvent extends PrincipesEvent<ModalResult>
Represents an event for closing a modal within the application. This event encapsulates the identifier of the modal being closed and the result of the modal action in the form of a ModalResult.

The event is designed to notify listeners when a modal has been closed, providing contextual information about the closure.

  • Constructor Details

    • CloseModalEvent

      public CloseModalEvent(String modalId, ModalResult payload)
      Constructs a CloseModalEvent with the specified modal identifier and payload. This event signifies the closure of a modal and includes data relevant to the result of the modal action.
      Parameters:
      modalId - the unique identifier of the modal being closed
      payload - the ModalResult object containing details about the closure result
  • Method Details

    • of

      public static CloseModalEvent of(String modalId, ModalResult payload)
      Creates a new CloseModalEvent instance with the specified modal identifier and result payload.
      Parameters:
      modalId - the unique identifier of the modal being closed
      payload - contains the result of the modal's operation, encapsulated in a ModalResult
      Returns:
      a new instance of CloseModalEvent with the provided modal identifier and result payload