【问题标题】:How to add a property page to an eclipse project (RCP / Plugin)如何将属性页添加到 Eclipse 项目(RCP / 插件)
【发布时间】:2017-02-16 11:05:28
【问题描述】:

我正在尝试将属性页添加到项目中。在第一步中,我使用模板向导来创建属性页。我将 targetclass 值从 org.eclipse.core.resources.IFile 更改为 org.eclipse.core.resources.IProject。但随后我启动​​插件并单击单个项目项,属性页未显示。

我已经测试了以下提示,但对我没有任何帮助:

我将我的代码简化为这个 plugin.xml:

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>

   <extension
         point="org.eclipse.ui.propertyPages">
      <page
            name="TEST Sample Page"
            nameFilter="*.*"
            class="testplugin.properties.SamplePropertyPage"
            id="testplugin.properties.samplePropertyPage">
        <enabledWhen>
            <adapt type="org.eclipse.core.resources.IProject">
                <test property="org.eclipse.core.resources.projectNature" 
                      value="org.eclipse.jdt.core.javanature"/>
            </adapt>         
        </enabledWhen>
      </page>
   </extension>

</plugin>

有人给我提示吗?

谢谢。 本

【问题讨论】:

    标签: java eclipse eclipse-plugin eclipse-rcp


    【解决方案1】:

    删除nameFilter="*.*"。这仅适用于尝试匹配特定文件类型,而不是项目。

    您还将属性页限制为仅在 Java 项目中显示。

    【讨论】:

    • 谢谢!这有帮助。 :)
    猜你喜欢
    • 1970-01-01
    • 2011-04-05
    • 2018-09-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-12
    • 1970-01-01
    相关资源
    最近更新 更多