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 Details

  • Constructor Details

    • ModuleDispatcher

      public ModuleDispatcher(EventBus eventBus)
      全局模块调度器 需要一个全局的事件总线
      Parameters:
      eventBus -
  • Method Details

    • 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:
      switchModule in interface IModuleDispatcher
      Parameters:
      code - the code
      parameter - the parameter
      saveToHistory - the save to history
      Returns:
      module dispatcher
    • onEvent

      public void onEvent(String topic, int type, Object event)
      Description copied from interface: IEventHandler
      事件处理.
      Specified by:
      onEvent in interface IEventHandler
      Parameters:
      topic - the topic
      type - the type
      event - the event
    • showMessage

      public void showMessage(int level, Integer code, String message)
      Description copied from interface: IShowMessage
      显示一个消息
      Specified by:
      showMessage in interface IShowMessage
      Parameters:
      level - 显示级别 0,1,2,3,4
      message - 显示的消息