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
Fields Modifier and Type Field Description static StringurlSeperator-
Fields inherited from interface cn.mapway.ui.client.mvc.IModuleDispatcher
KEY_MODULE_HASHES, MODULE_DISPATCH_EVENT, MODULE_RETURN_EVENT
-
-
Constructor Summary
Constructors Constructor Description ModuleDispatcher(EventBus eventBus)全局模块调度器 需要一个全局的事件总线
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonEvent(String topic, int type, Object event)事件处理.static HashParameterparseHashParameter(String excludeFirst, String hash)* 解析HAsh参数 * 324525;238;32432 * 模块ID 模块参数 * 本函数的功能 提取第一个参数到hash中voidshowMessage(int level, Integer code, String message)显示一个消息IModuleDispatcherswitchModule(String code, ModuleParameter parameter, boolean saveToHistory)切换模块.
-
-
-
Field Detail
-
urlSeperator
public static final String urlSeperator
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ModuleDispatcher
public ModuleDispatcher(EventBus eventBus)
全局模块调度器 需要一个全局的事件总线- Parameters:
eventBus-
-
-
Method Detail
-
parseHashParameter
public static HashParameter parseHashParameter(String excludeFirst, String hash)
* 解析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
public void onEvent(String topic, int type, Object event)
Description copied from interface:IEventHandler事件处理.- Specified by:
onEventin interfaceIEventHandler- Parameters:
topic- the topictype- the typeevent- the event
-
showMessage
public void showMessage(int level, Integer code, String message)Description copied from interface:IShowMessage显示一个消息- Specified by:
showMessagein interfaceIShowMessage- Parameters:
level- 显示级别 0,1,2,3,4message- 显示的消息
-
-