Eclipse外掛程式開發之快速嚮導__Eclipse外掛程式

來源:互聯網
上載者:User

說明:本文並不是教你如何建立一個嚮導,而是在你已經有個嚮導的前提下,怎麼通過比如功能表列File的New按鈕、快捷工具列New按鈕、資源管理員的New按鈕快速的啟動嚮導。並且已經通過擴充點建立了一個嚮導Smave Project。 通過File菜單和快捷工具列快速啟動嚮導

這個比較簡單,只需要在Perspective(透視圖)的實作類別裡加入layout.addNewWizardShortcut(String wizardID)就可以了;
效果如下圖所示:

在資源管理員中快速啟動嚮導

擴充資源管理員當然要用到CNF的擴充點了,此處要用到擴充點org.eclipse.ui.navigator.navigatorContent,我們需要擴充的是commonWizard這個element,看看官方是怎麼描述的:Defines a binding between an existing Eclipse New/Import/Export Wizard and a given set of items. Each valid binding determines which menu items will appear in the submenus for New/Import/Export in the context menu of a Common Navigator Viewer. Since Eclipse 3.2.1, the wizard menu items respect Eclipse Capabilities (see org.eclipse.ui.activites for more information).
也就是說New/Import/Export均可以通過此擴充點進行定製。
效果如下圖所示:
其它方式快速啟動嚮導

還有一種和嚮導相關的快捷啟動方式,如下:

像這種方式顯示該怎麼做呢。
其實這樣做是官方不推薦的,通過擴充點org.eclipse.ui.newWizards的primaryWizard實現,
我們先看一下官方描述:a means of declaring that a wizard is “primary” in the UI. A primary wizard is emphasized in the new wizard dialog. Please note that this element is not intended to be used by plug in developers! This element exists so that product managers may emphasize a set of wizards for their products.
通過描述我們可以看出Eclipse官方是不推薦外掛程式開發人員這樣做的。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.