Class FallbackEvent

java.lang.Object
java.util.EventObject
com.vaadin.flow.component.ComponentEvent<VaadinCKEditor>
com.wontlost.ckeditor.event.FallbackEvent
All Implemented Interfaces:
Serializable

public class FallbackEvent extends com.vaadin.flow.component.ComponentEvent<VaadinCKEditor>
Fallback event. Fired when the editor triggers a fallback mode due to an error.

Usage example:

editor.addFallbackListener(event -> {
    if (event.getMode() == FallbackMode.TEXTAREA) {
        // Editor has fallen back to a plain textarea
        Notification.show("Editor failed to load, switched to basic mode",
            Notification.Type.WARNING_MESSAGE);
    }

    // Log the fallback reason
    logger.warn("Editor fallback triggered: {}", event.getReason());
});
See Also:
  • Constructor Details

    • FallbackEvent

      public FallbackEvent(VaadinCKEditor source, boolean fromClient, FallbackEvent.FallbackMode mode, String reason, String originalError)
      Create a fallback event.
      Parameters:
      source - the editor component that fired the event
      fromClient - whether the event originated from the client
      mode - the fallback mode
      reason - description of the fallback reason
      originalError - the original error message
  • Method Details

    • getMode

      public FallbackEvent.FallbackMode getMode()
      Get the fallback mode.
      Returns:
      the current fallback mode
    • getReason

      public String getReason()
      Get the fallback reason.
      Returns:
      a human-readable fallback reason
    • getOriginalError

      public String getOriginalError()
      Get the original error message.
      Returns:
      the original error that triggered the fallback, may be null