是不是扩展Eclipse包资源管理器? [英] Is Extending Eclipse Package Explorer Impossible?

查看:165
本文介绍了是不是扩展Eclipse包资源管理器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过绑定自定义navigatorContent来扩展Eclipse的Package Explorer?

Is it possible to extend the Package Explorer of Eclipse by binding a custom navigatorContent?

当我使用自定义navigatorContent测试Project Explorer时,如下面的xml代码,我的contentProvider和labelProvider在Project Explorer中工作正常。

When I tested the Project Explorer with my custom navigatorContent, like the xml code below, my contentProvider and labelProvider worked fine with the Project Explorer.

但是使用Package Explorer,这意味着我将'org.eclipse.ui.navigator.ProjectExplorer'替换为'viewerId'属性中的'org.eclipse.jdt.ui.PackageExplorer',没有。

But with the Package Explorer, which means that I substituted 'org.eclipse.ui.navigator.ProjectExplorer' with 'org.eclipse.jdt.ui.PackageExplorer' in the 'viewerId' attribute, it didn't.

所以我想确认是否可以扩展Package Explorer通过自定义navigatorContent或不。

So I want to confirm whether the Package Explorer can be extended by custom navigatorContent or not.

这是我的plugin.xml的摘要。

Here is the abstract of my plugin.xml.

<extension
    point="org.eclipse.ui.navigator.viewer">
    <viewer
        viewerId="org.eclipse.ui.navigator.ProjectExplorer">
    </viewer>
    <viewerContentBinding
        viewerId="org.eclipse.ui.navigator.ProjectExplorer">
        <includes>
            <contentExtension
                pattern="abc.pkg.explorer.navigator.propertiesContent">
            </contentExtension>
        </includes>
    </viewerContentBinding>
</extension>
<extension
    point="org.eclipse.ui.navigator.navigatorContent"> 
    <navigatorContent
        id="abc.pkg.explorer.navigator.propertiesContent"
    .. omitted below.


推荐答案

我找到答案。

这是不可能的,因为'Package Explorer'不使用'CommonNavigator'。

It is not possible because 'Package Explorer' doesn't use the 'CommonNavigator'.

如果你想扩展'资源管理器,你应该这样做。

If you want to extend the 'Package Explorer', you should do the other way.

也就是说,你需要做一个扩展'CommonNavigator'的定制视图,然后绑定'Java Element'navigatorContent与您的自定义视图。
您可以在org.eclipse.jdt.ui插件中找到Java ElementnavigatorContent,其中包含Package Explorer。

That is to say, you need to make a custom view extending 'CommonNavigator', and then bind 'Java Element' navigatorContent with your custom view. You can find 'Java Element' navigatorContent in the 'org.eclipse.jdt.ui' plug-in which includes the 'Package Explorer'.

这篇关于是不是扩展Eclipse包资源管理器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆