Eclipse Workbench Structure分析

IWorkbench
public interface IWorkbench
   
   
    
    extends 
    
    IAdaptable, 
    
    IServiceLocator
   
   

A workbench is the root object for the Eclipse Platform user interface.

A workbench has one or more main windows which present to the end user information based on some underlying model, typically on resources in an underlying workspace. A workbench usually starts with a single open window, and automatically closes when its last window closes.

Each workbench window has a collection of pages; the active page is the one that is being presented to the end user; at most one page is active in a window at a time.

Each workbench page has a collection of workbench parts, of which there are two kinds: views and editors. A page's parts are arranged (tiled or stacked) for presentation on the screen. The arrangement is not fixed; the user can arrange the parts as they see fit. A perspective is a template for a page, capturing a collection of parts and their arrangement.

The platform creates a workbench when the workbench plug-in is activated; since this happens at most once during the life of the running platform, there is only one workbench instance. Due to its singular nature, it is commonly referred to as the workbench.

如上文注释所说,一个Workbench包含一个或多个WorkbenchWindow(这个应该很好理解),一个WorkbenchWindow包含众多的WorkbenchPage,一个WorkbenchPage包括众多的WorkbenchPart(Editor或View)。Perspective相当于而已管理器,用来为WorkbenchPage布局的,同时也控制着诸如一ActionSets,NewWizardShortcut,ViewShortcut,PerspectiveShortcut的显示。

IWorkbenchWindow
public interface IWorkbenchWindow
   
   
    
    extends 
    
    IPageService, 
    
    IRunnableContext, 
    
    IServiceLocator, 
    
    IShellProvider
   
   

A workbench window is a top level window in a workbench. Visually, a workbench window has a menubar, a toolbar, a status bar, and a main area for displaying a single page consisting of a collection of views and editors.

Each workbench window has a collection of 0 or more pages; the active page is the one that is being presented to the end user; at most one page is active in a window at a time.

注释说明:一个WorkbenchWindow包括0或多个WorkbenchPage。另外,根据我的测试,一个WorkbenchWindow最多只包括1个WorkbenchPage。

IWorkbenchPage

public interface IWorkbenchPage

   
   
    
    extends 
    
    IPartService, 
    
    ISelectionService, org.eclipse.ui.internal.ICompatibleWorkbenchPage
   
   

A workbench page consists of an arrangement of views and editors intended to be presented together to the user in a single workbench window.

A page can contain 0 or more views and 0 or more editors. These views and editors are contained wholly within the page and are not shared with other pages. The layout and visible action set for the page is defined by a perspective.

注释:一个Workbench包含0或N(N>0)个View(或Editor)。

至于Perspective,我个人觉得它应该是属于WorkbenchPage中的内容,这个在WorkbenchPage的源码可以印证,WorkbenchPage中有这样的变量声明"private PerspectiveList perspList = new PerspectiveList();"。

下面这张图应该可以较好的说明Eclipse Workbench Structure.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值