Eclipse Workbench Structure分析

來源:互聯網
上載者:User
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.

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.