桌面程序框架大牛RCP

RCP应用程序至少需要一个视角来定义窗口的布局。视角可以看作是窗口的布局提示集合。每个IWorkbenchWindow有一个页面,它拥有编辑器和视图实例,并根据活动视角决定布局。视角详细说明了如何以及是否显示某些内容,如视图、编辑器区域和操作。透视图工厂提供视角的初始布局,用户可以重新排列视角内容,工作台在退出时保存设置并在启动时恢复。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

ll RCP applications must define at least one perspective; otherwise, there would be nothing to lay out the views. Think of a perspective as a set of layout hints for a window . Every IWorkbenchWindow has one page. The page owns its editor and view instances and uses the active perspective to decide its layout. The perspective details where, and whether or not, to show certain things, such as views, the editor area, and actions. The following provides an overview of the main parts of an IWorkbenchWindow.

 

 

A perspective factory provides the initial layout for a perspective. When a perspective is needed, the factory is created and passed an IPageLayout to which views are added. The factory is then discarded. As the user rearranges the contents of the perspective, the Workbench saves the settings on exit and restores them at startup (if so configured). The perspective generated by the PDE template uses the default layout. IPageLayout contains several methods for defining the layout of a perspective. Everything added to a perspective is related to something else.

 

 

eg:

 

Here the editor area is used as the base for placing the Contacts view. The Contacts view is added to the left of the editor area and is given all available space in the page by specifying 1.0f as the layout ratio. The ratio describes how to divide the available space between the Contacts view and its reference part, in this case, the editor area. The ratio must be between 0.0f (only the title bar is shown) and 1.0f (the view takes up the entire window area).

 

NOTE

 

Editors cannot be added to a perspective layout. Instead, you position the area in the perspective in which editors are opened. It’s also possible to hide and show the editor area using IWorkbenchPage.setEditorAreaVisible(boolean).

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值