Rich client platform
This presentation is the property of its rightful owner.
Sponsored Links
1 / 15

信威核心网网管培训 -- Rich Client Platform PowerPoint PPT Presentation


  • 153 Views
  • Uploaded on
  • Presentation posted in: General

信威核心网网管培训 -- Rich Client Platform. 主讲:胡俊 部门:核心网支撑技术部 项目组: MMI. 几个重要的概念. Applications Workbenches Workbench Windows. Application. Application 是一个你创建的作为 RCP 主程序的类。你可以认为它是程序的控制器。就象 MVC 架构中的控制器一样,它很短小,并且在不同的项目中都差不多。它所做的就是创建一个 Workbench, 并交给 Workbench 一个 Workbench Advisor. Workbench.

Download Presentation

信威核心网网管培训 -- Rich Client Platform

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Rich client platform

信威核心网网管培训--Rich Client Platform

主讲:胡俊

部门:核心网支撑技术部

项目组:MMI


Rich client platform

几个重要的概念

  • Applications

  • Workbenches

  • Workbench Windows


Application

Application

  • Application是一个你创建的作为RCP主程序的类。你可以认为它是程序的控制器。就象MVC架构中的控制器一样,它很短小,并且在不同的项目中都差不多。它所做的就是创建一个Workbench,并交给Workbench一个Workbench Advisor


Workbench

Workbench

  • Workbench是作为RCP框架的一部分被声明和维护的。一个Application只有一个Workbench,但是一个Workbench可以有超过一个可见的顶层Workbench Window。例如,在Eclipse IDE中,当你第一次启动Eclipse时,你会看到一个Workbench Window,但是如果你选择Window > New Window,就会出现第二个窗口,这样就有两个Workbench Window,而还是单独一个Workbench


Rich client platform

关系

一个RCP程序有一个用户定义的Application类,和一个框架提供的Workbench类。一般只有一个Workbench Window,但是框架支持多个Workbench Window


Rich client platform

相关代码

public class Application implements IPlatformRunnable {

public Object run(Object args) throws Exception

{

Display display = PlatformUI.createDisplay();

try {

Int returnCode =PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor());

.

.


Rich client platform

生命周期


Workbenchadvisor

深入WorkbenchAdvisor

WorkbenchAdvisor子类中可以重写来处理Workbench生命周期事件的所有方法


Rich client platform

在WorkbenchAdvisor子类中可以重写来处理Workbench Window生命周期事件的方法


Rich client platform

可以实现一些方法供Platform调用,使得Platform获取关于你应用的信息


Rich client platform

在某些情况,RCP又提供了两个方法来控制你的应用窗口和控件如何被创建


Workbenchadvisor1

几种类型的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.


Rich client platform

准备国际化

  • 文字(Eclipse IDE提供了一个不错的Externalization的向导来使工作变得容易些)


Rich client platform

开始编码-登录

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.EXIT_OK;

int returnCode = PlatformUI.createAndRunWorkbench(display,

new ApplicationWorkbenchAdvisor());

if (returnCode == PlatformUI.RETURN_RESTART) {

return IPlatformRunnable.EXIT_RESTART;

}

return IPlatformRunnable.EXIT_OK;

} finally {

display.dispose();

}

}


  • Login