Class EventDispatcher
java.lang.Object
com.wontlost.ckeditor.internal.EventDispatcher
管理编辑器事件分发的内部类。
提供类型安全的事件注册和分发机制。
此类是内部 API,不应直接由外部代码使用。
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.RegistrationaddAutosaveListener(com.vaadin.flow.component.ComponentEventListener<AutosaveEvent> listener) 添加自动保存监听器com.vaadin.flow.shared.RegistrationaddContentChangeListener(com.vaadin.flow.component.ComponentEventListener<ContentChangeEvent> listener) 添加内容变更监听器com.vaadin.flow.shared.RegistrationaddEditorErrorListener(com.vaadin.flow.component.ComponentEventListener<EditorErrorEvent> listener) 添加错误监听器com.vaadin.flow.shared.RegistrationaddEditorReadyListener(com.vaadin.flow.component.ComponentEventListener<EditorReadyEvent> listener) 添加编辑器就绪监听器com.vaadin.flow.shared.RegistrationaddFallbackListener(com.vaadin.flow.component.ComponentEventListener<FallbackEvent> listener) 添加回退模式监听器voidcleanup()清理所有监听器voidfireAutosave(String content, boolean success, String errorMessage) 触发自动保存事件voidfireContentChange(String oldContent, String newContent, ContentChangeEvent.ChangeSource changeSource) 触发内容变更事件boolean触发错误事件voidfireEditorReady(long initTimeMs) 触发编辑器就绪事件voidfireFallback(FallbackEvent.FallbackMode mode, String reason, String originalError) 触发回退模式事件获取错误处理器获取已注册监听器的统计信息voidsetErrorHandler(ErrorHandler errorHandler) 设置错误处理器
-
Constructor Details
-
EventDispatcher
-
-
Method Details
-
setErrorHandler
-
getErrorHandler
-
addEditorReadyListener
public com.vaadin.flow.shared.Registration addEditorReadyListener(com.vaadin.flow.component.ComponentEventListener<EditorReadyEvent> listener) 添加编辑器就绪监听器- Parameters:
listener- 监听器- Returns:
- 注册句柄,用于移除监听器
-
addEditorErrorListener
public com.vaadin.flow.shared.Registration addEditorErrorListener(com.vaadin.flow.component.ComponentEventListener<EditorErrorEvent> listener) 添加错误监听器- Parameters:
listener- 监听器- Returns:
- 注册句柄
-
addAutosaveListener
public com.vaadin.flow.shared.Registration addAutosaveListener(com.vaadin.flow.component.ComponentEventListener<AutosaveEvent> listener) 添加自动保存监听器- Parameters:
listener- 监听器- Returns:
- 注册句柄
-
addContentChangeListener
public com.vaadin.flow.shared.Registration addContentChangeListener(com.vaadin.flow.component.ComponentEventListener<ContentChangeEvent> listener) 添加内容变更监听器- Parameters:
listener- 监听器- Returns:
- 注册句柄
-
addFallbackListener
public com.vaadin.flow.shared.Registration addFallbackListener(com.vaadin.flow.component.ComponentEventListener<FallbackEvent> listener) 添加回退模式监听器- Parameters:
listener- 监听器- Returns:
- 注册句柄
-
fireEditorReady
public void fireEditorReady(long initTimeMs) 触发编辑器就绪事件- Parameters:
initTimeMs- 初始化耗时(毫秒)
-
fireEditorError
触发错误事件- Parameters:
error- 错误信息- Returns:
- 如果错误被处理器处理则返回 true
-
fireAutosave
-
fireContentChange
public void fireContentChange(String oldContent, String newContent, ContentChangeEvent.ChangeSource changeSource) 触发内容变更事件- Parameters:
oldContent- 旧内容newContent- 新内容changeSource- 变更来源
-
fireFallback
触发回退模式事件- Parameters:
mode- 回退模式reason- 原因originalError- 原始错误
-
cleanup
public void cleanup()清理所有监听器 -
getListenerStats
-