An RCP application should declare a subclass of WorkbenchAdvisor and override methods to configure the workbench to suit the needs of the particular application.
The following advisor methods are called at strategic points in the workbench's lifecycle (all occur within the dynamic scope of the call to PlatformUI.createAndRunWorkbench):
initialize - called first; before any windows; use to register things
preStartup - called second; after initialize but before first window is opened; use to temporarily disable things during startup or restore
postStartup - called third; after first window is opened; use to reenable things temporarily disabled in previous step
postRestore - called after the workbench and its windows has been recreated from a previously saved state; use to adjust the restored workbench
preWindowOpen - called as each window is being opened; use to configure aspects of the window other than actions bars
fillActionBars - called after preWindowOpen to configure a window's action bars
postWindowRestore - called after a window has been recreated from a previously saved state; use to adjust the restored window
postWindowCreate - called after a window has been created, either from an initial state or from a restored state; used to adjust the window
openIntro - called immediately before a window is opened in order to create the introduction component, if any.
postWindowOpen - called after a window has been opened; use to hook window listeners, etc.
preWindowShellClose - called when a window's shell is closed by the user; use to pre-screen window closings
eventLoopException - called to handle the case where the event loop has crashed; use to inform the user that things are not well
eventLoopIdle - called when there are currently no more events to be processed; use to perform other work or to yield until new events enter the queue
preShutdown - called immediately prior to workbench shutdown before any windows have been closed; allows the advisor to veto the shutdown
postShutdown - called last; after event loop has terminated and all windows have been closed; use to deregister things registered during initialize
分享到:
相关推荐
1. 编写主程序类:在RCP应用中,主程序类通常继承自`org.eclipse.ui.application.WorkbenchAdvisor`,并覆盖其中的方法来定制启动行为。 2. 创建插件定义:在`plugin.xml`文件中,定义应用的启动类和扩展点,如菜单...
### eclipsercp教程知识点详解 #### 一、RCP框架概述 RCP(Rich Client Platform)框架是一种基于Java的富客户端开发框架,主要用于构建高度交互式的桌面应用程序。Eclipse RCP作为该领域的佼佼者,以其强大的插件...
Eclipse RCP,全称是Eclipse Rich Client Platform,是一个开放源码的框架,用于构建桌面应用程序。它基于Java语言,提供了丰富的用户界面组件、插件机制和强大的开发工具,使得开发者可以快速构建功能强大的、可...
在Eclipse生成的RCP应用模板中,Application类通常非常简洁,主要工作是初始化Workbench,并通过WorkbenchAdvisor来管理应用程序的行为。 2. **ApplicationWorkbenchAdvisor类**: 继承自WorkbenchAdvisor,...
Eclipse RCP(Rich Client Platform)是一个用于构建桌面应用程序的框架,它基于Java语言,提供了丰富的用户界面组件和强大的插件扩展机制。本教程将深入分析RCP框架的关键概念和核心类,帮助开发者更好地理解和使用...
本文将深入剖析Eclipse RCP的核心组件与工作原理,特别聚焦于其入门级教程中提及的关键类——`Application`, `ApplicationWorkbenchAdvisor`, `WorkbenchAdvisor`, `ApplicationWorkbenchWindowAdvisor`, 以及`...
【Eclipse RCP基础知识概述】 Eclipse RCP(Rich Client Platform)是Eclipse IDE的一个核心组件,它提供了一个用于构建复杂桌面应用的框架。RCP应用程序通常由多个组件构成,如视图(Views)、编辑器(Editors)、...
5. 创建一个主类,继承自 `org.eclipse.ui.application.WorkbenchAdvisor` 和 `org.eclipse.ui.application.WorkbenchWindowAdvisor`,这两个类负责启动工作台和窗口的初始化。 四、编写测试代码 在 "test2" 这个...
3. **创建启动类**:在插件项目中,你需要创建一个启动类,继承自`org.eclipse.ui.application.WorkbenchAdvisor`,并覆盖其中的方法以初始化你的应用。 4. **配置运行时**:在项目的`.product`文件中,你可以定义...
在Eclipse RCP中,`WorkbenchAdvisor`类是工作台的顾问,它提供了对工作台生命周期事件的处理。而`ApplicationWorkbenchWindowAdvisor`是`WorkbenchAdvisor`的一个子类,专用于应用程序的工作台窗口。通过重写其方法...
- **作用**:作为RCP应用的入口点,负责创建`Workbench`并添加`WorkbenchAdvisor`。 - **实现接口**:通常实现`IPlatformRunnable`接口。 - **主要功能**:启动RCP应用,管理应用程序生命周期。 2. **Advisor类*...
在新创建的项目中,编写你的主程序类,继承自`org.eclipse.ui.application.WorkbenchAdvisor`。这个类将定义你的应用程序入口点。 5. **添加依赖** RCP程序可能依赖于其他的库或插件,你需要在MANIFEST.MF文件中...
`org.eclipse.ui.application.WorkbenchAdvisor`定义了工作台的启动和关闭行为,`org.eclipse.ui.perspectiveExtensions`允许扩展透视图,`org.eclipse.ui.views`则用于注册新的视图,`org.eclipse.ui.editors`用于...
在Eclipse Rich Client Platform (RCP)中,构建应用程序的核心组件包括Display、Shell、Workbench以及Advisor类。这些组件构成了RCP应用的基础架构,用于创建和管理用户界面。 1. Display: Display对象是SWT...
1. **启动类**: 这通常是一个扩展自`org.eclipse.ui.application.WorkbenchAdvisor`的类,用于启动GEF应用。 2. **编辑领域类**: 实现`org.eclipse.gef.editparts.AbstractGraphicalEditPart`,它是图形编辑的基本...