Package cn.mapway.ui.client.frame
Class ModuleDispatcher
java.lang.Object
cn.mapway.ui.client.frame.ModuleDispatcher
- All Implemented Interfaces:
IEventHandler,IModuleDispatcher,IShowMessage
public class ModuleDispatcher
extends Object
implements IModuleDispatcher, IEventHandler, IShowMessage
ModuleDispatcher
有两种事件的发生 会调度到这个模块调度器
1. 直接调用本类提供的接口 switchModule
2.接受来自 eventBus 上的模块调度消息
-调度模块
-返回之前的模块
关于 URL中Hash 1.之前版本中的hash只支持一级模块 #2A3F12 2.变更之后支持多级模块的调度 #2A3F12;34490;443443
- Author:
- zhangjianshe@gmail.com
-
Field Summary
FieldsFields inherited from interface cn.mapway.ui.client.mvc.IModuleDispatcher
KEY_MODULE_HASHES, MODULE_DISPATCH_EVENT, MODULE_RETURN_EVENT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid事件处理.static HashParameterparseHashParameter(String excludeFirst, String hash) * 解析HAsh参数 * 324525;238;32432 * 模块ID 模块参数 * 本函数的功能 提取第一个参数到hash中voidshowMessage(int level, Integer code, String message) 显示一个消息switchModule(String code, ModuleParameter parameter, boolean saveToHistory) 切换模块.
-
Field Details
-
urlSeperator
- See Also:
-
-
Constructor Details
-
ModuleDispatcher
全局模块调度器 需要一个全局的事件总线- Parameters:
eventBus-
-
-
Method Details
-
parseHashParameter
* 解析HAsh参数 * 324525;238;32432 * 模块ID 模块参数 * 本函数的功能 提取第一个参数到hash中- Parameters:
excludeFirst- 第一个参数过滤hash-- Returns:
-
switchModule
public IModuleDispatcher switchModule(String code, ModuleParameter parameter, boolean saveToHistory) Description copied from interface:IModuleDispatcher切换模块.- Specified by:
switchModulein interfaceIModuleDispatcher- Parameters:
code- the codeparameter- the parametersaveToHistory- the save to history- Returns:
- module dispatcher
-
onEvent
Description copied from interface:IEventHandler事件处理.- Specified by:
onEventin interfaceIEventHandler- Parameters:
topic- the topictype- the typeevent- the event
-
showMessage
Description copied from interface:IShowMessage显示一个消息- Specified by:
showMessagein interfaceIShowMessage- Parameters:
level- 显示级别 0,1,2,3,4message- 显示的消息
-