【问题标题】:All the available tags in plugin.xml in eclipseeclipse 中 plugin.xml 中的所有可用标签
【发布时间】:2013-07-06 14:59:49
【问题描述】:

对于eclipse插件开发,如何知道plugin.xml中有哪些标签可用?
有没有可用的标签列表?

【问题讨论】:

    标签: eclipse plugin.xml


    【解决方案1】:

    plugin.xml 中可用的标签集不是有限的,在不同的 Eclipse 安装中也不相同。扩展点由确定其 plugin.xml 子集架构的各种插件提供。

    为了理解这一点,不要使用文本编辑器来编辑 plugin.xml 文件。始终使用 PDE 附带的基于表单的编辑器。它将指导您发现可用的扩展点及其属性。

    【讨论】:

      【解决方案2】:

      来自eclipse.org给出的article需要在plugin.xml中设置这些标签

      <?xml version="1.0"?>
      <plugin
          name="Eclipse Hello World Example"
          id="org.eclipse.examples.helloworld"
          version="0.0.0"
          provider-name="OTI">
      
          <requires>
          <import plugin="org.eclipse.core.resources"/>
              <import plugin="org.eclipse.ui"/>
          </requires>
      
          <runtime>
          <library name="helloworld.jar"/>
          </runtime>
      
          <extension point = "org.eclipse.ui.actionSets">
              <actionSet
                  id="org.eclipse.examples.helloworld.HelloWorldActionSet"
                  label="Hello World"
              visible="true"
              description="The action set for the Eclipse Hello World example">
              <menu
              id="org.eclipse.examples.helloworld.HelloWorldMenu"
              label="Samples">
              <separator name="samples"/>
              </menu>
              <action id="org.eclipse.examples.helloworld.actions.HelloWorldAction"
              menubarPath="org.eclipse.examples.helloworld.HelloWorldMenu/samples"
              toolbarPath="Normal"            
              label="Hello World"
              tooltip="Press to see a message"
              icon="icons/helloworld.gif"
              class="org.eclipse.examples.helloworld.HelloWorldAction"/>
              </actionSet>
          </extension>
      </plugin>
      

      只需编辑 plugin.xml 文件并根据您的插件配置放置这些标签
      您可以使用 Eclipse 使用默认文本编辑器编辑此文件。为此,请选择 Window -> Preferences, 展开 Workbench 条目,然后选择 File Associations。 添加 resource extension xml, 并添加 文本编辑器与其关联。现在,当您尝试在 .xml 文件上打开编辑器时,您将使用默认的文本编辑器来执行此操作。PDE 让复杂插件更容易做到这一点

      【讨论】:

      • 问题不是要一个示例 plugin.xml 文件。
      猜你喜欢
      • 2014-09-27
      • 1970-01-01
      • 2011-10-20
      • 2011-01-17
      • 2013-03-30
      • 1970-01-01
      • 1970-01-01
      • 2010-09-10
      • 1970-01-01
      相关资源
      最近更新 更多