信威核心网网培训--RichClientPlatform.pptVIP

  • 3
  • 0
  • 约3.72千字
  • 约 15页
  • 2018-08-27 发布于江苏
  • 举报
信威核心网网培训--RichClientPlatform

信威核心网网管培训 --Rich Client Platform 主讲:胡俊 部门:核心网支撑技术部 项目组:MMI 几个重要的概念 Applications Workbenches Workbench Windows Application Application是一个你创建的作为RCP主程序的类。你可以认为它是程序的控制器。就象MVC架构中的控制器一样,它很短小,并且在不同的项目中都差不多。它所做的就是创建一个Workbench,并交给Workbench一个Workbench Advisor Workbench Workbench是作为RCP框架的一部分被声明和维护的。一个Application只有一个Workbench,但是一个Workbench可以有超过一个可见的顶层Workbench Window。例如,在Eclipse IDE中,当你第一次启动Eclipse时,你会看到一个Workbench Window,但是如果你选择Window New Window,就会出现第二个窗口,这样就有两个Workbench Window,而还是单独一个Workbench 关系 相关代码 public class Application implements IPlatformRunnable { public Object run(Object args) throws Exception { Display display = PlatformUI.createDisplay(); try { Int returnCode =PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor()); . . 生命周期 深入WorkbenchAdvisor WorkbenchAdvisor子类中可以重写来处理Workbench生命周期事件的所有方法 在WorkbenchAdvisor子类中可以重写来处理Workbench Window生命周期事件的方法 可以实现一些方法供Platform调用,使得Platform获取关于你应用的信息 在某些情况,RCP又提供了两个方法来控制你的应用窗口和控件如何被创建 几种类型的workbenchAdvisor application-level WorkbenchAdvisor start up and shut down of the Workbench itself; there is one running Workbench per running Eclipse application. window-level WorkbenchWindowAdvisor showing or hiding the menu, toolbar, and status line, and in configuring the controls shown in the window. There is one WorkbenchWindowAdvisor instance for each window ActionBarAdvisor helps define the actions that appear in the menu, toolbar, and status line of each window. There is one ActionBarAdvisor instance for each window. 准备国际化 文字(Eclipse IDE提供了一个不错的Externalization的向导来使工作变得容易些) 开始编码-登录 public class Application implements IPlatformRunnable { public static final String PLUGIN_ID = “com.xinwei.cnms; public Object run(Object args) throws Exception { Display display = PlatformUI.createDisplay(); try { Platform.endSplash(); if (!login()) return IPlatformRunnable

文档评论(0)

1亿VIP精品文档

相关文档