我想在Eclipse 4.2的Project Explorer中將孩子添加到我的文件中。我使用「帶有多頁面編輯器的插件」模板製作了一個RCP項目。運行它,使用嚮導將我的文件類型(.mpe)添加到某個現有項目,這一切都正常。現在我想讓我的文件類型(1)具有可點擊的孩子,例如.h文件具有(2)。這個怎麼做?項目資源管理器,帶孩子的項目
3
A
回答
1
你將不得不提供擴展 「org.eclipse.ui.navigator.viewer」 和 「org.eclipse.ui.navigator.navigatorContent」。項目瀏覽器基於Common導航框架,它允許用戶擴展功能。
一個例子
的 「org.eclipse.ui.navigator.viewer」 擴展
<extension
id="navigator-viewbinding"
point="org.eclipse.ui.navigator.viewer">
<viewerContentBinding
viewerId="org.eclipse.ui.navigator.ProjectExplorer">
<includes>
<contentExtension
pattern="<plugin_name>.myResourceContent">
</contentExtension>
</includes>
</viewerContentBinding>
</extension>
而 「org.eclipse.ui.navigator.navigatorContent」 擴展
<extension
id="navigator-content"
point="org.eclipse.ui.navigator.navigatorContent">
<navigatorContent
activeByDefault="true"
contentProvider="MyNavigatorContentProvider"
icon="icon.gif"
id="myResourceContent"
labelProvider="MyNavigatorLabelProvider"
name="Some Name"
priority="normal">
<triggerPoints>
<or>
<and>
<instanceof
value="org.eclipse.core.resources.IFile">
</instanceof>
<test
property="org.eclipse.core.resources.extension"
value="mpe">
</test>
</and>
</or>
</triggerPoints>
<possibleChildren>
<or>
<instanceof
value="<Class name of possible children>">
</instanceof>
</or>
</possibleChildren>
</extension>
類「MyNavigatorContentProvider」實現了「ICommonContentProvider」,你將不得不解析你的文件&得到你想要顯示的孩子。類「MyNavigatorLabelProv IDER」來裝飾你的孩子在觀衆..
希望這link應該幫助
相關問題
- 1. NetBeans項目的從資源管理器
- 2. Eclipse:在項目資源管理器中找不到項目
- 3. 項目訂單Eclipse項目資源管理器視圖
- 4. 如何獲取在資源管理器或項目資源管理器中選擇的項目列表?
- 5. 項目管理 - 資源圖表
- 6. Solaris 9項目(資源管理)
- 7. 在解決方案資源管理器中創建子項目
- 8. Eclipse開普勒:隱藏項目資源管理器中的特定項目
- 9. 日食顯示項目資源管理器只有 「打開的項目」
- 10. TFS項目在源代碼管理資源管理器中可見,但不在團隊資源管理器中?
- 11. SBT:訪問子項目的管理資源?
- 12. Visual Studio源代碼管理資源管理器重複TFS項目文件夾
- 13. 項目節點上的團隊資源管理器2010錯誤?
- 14. Eclipse項目中的文件資源管理器
- 15. vs.net 2010 MVC項目的解決方案資源管理器
- 16. Eclipse中的項目資源管理器未顯示
- 17. Powershell的調用,項目不再工作在資源管理器
- 18. 解決方案資源管理器中的選定項目
- 19. Eclipse RCP的 - 屬性添加到項目資源管理器
- 20. 列出谷歌雲資源管理器中的所有項目
- 21. 帶靜態項目的XAML資源?
- 22. 如何用TFS團隊資源管理器搜索項目?
- 23. 使用雲資源管理器API創建Google雲項目
- 24. Eclipse項目資源管理器空ubuntu上
- 25. Project Explorer從項目資源管理器中消失-Eclipse kepler
- 26. 安卓eclipse項目在資源管理器中消失
- 27. 保存Aptana Studio 3項目資源管理器狀態關閉
- 28. 從eclipse項目資源管理器中刪除.settings文件夾
- 29. Eclipse RCP - 選定項目(包資源管理器)
- 30. 在解決方案資源管理器中缺少SilverLight項目
謝謝,終於找到時間來測試它,按預期工作。 –