Class FallbackEvent
java.lang.Object
java.util.EventObject
com.vaadin.flow.component.ComponentEvent<VaadinCKEditor>
com.wontlost.ckeditor.event.FallbackEvent
- All Implemented Interfaces:
Serializable
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:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionFallbackEvent(VaadinCKEditor source, boolean fromClient, FallbackEvent.FallbackMode mode, String reason, String originalError) Create a fallback event. -
Method Summary
Modifier and TypeMethodDescriptiongetMode()Get the fallback mode.Get the original error message.Get the fallback reason.Methods inherited from class com.vaadin.flow.component.ComponentEvent
getSource, isFromClient, unregisterListenerMethods inherited from class EventObject
toString
-
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 eventfromClient- whether the event originated from the clientmode- the fallback modereason- description of the fallback reasonoriginalError- the original error message
-
-
Method Details
-
getMode
Get the fallback mode.- Returns:
- the current fallback mode
-
getReason
-
getOriginalError
Get the original error message.- Returns:
- the original error that triggered the fallback, may be null
-