美文网首页
插件配置文件

插件配置文件

作者: pr488 | 来源:发表于2017-01-08 14:29 被阅读71次

    原文链接:
    http://www.jetbrains.org/intellij/sdk/docs/basics/plugin_structure/plugin_configuration_file.html

    这是一个示例插件配置文件,它展示和描述了可在plugin.xml文件中使用的所有元素。

    <!-- url=""指定插件主页的链接(显示在欢迎界面和"插件"设置对话框)-->
    <idea-plugin url="http://www.jetbrains.com/idea">
    
      <!-- 插件名称 -->
      <name>VssIntegration</name>
    
      <!-- 插件的唯一标识符,不能在不同插件版本之间更改
           如果未指定则与<name>相同 -->
      <id>VssIntegration</id>
    
      <!-- 插件的描述 -->
      <description>Vss integration plugin</description>
    
      <!-- 插件最新版本的更改描述
          显示在"插件"设置对话框和插件库Web界面 -->
      <change-notes>Initial release of the plugin.</change-notes>
    
      <!-- 插件版本 -->
      <version>1.0</version>
    
      <!-- 插件的厂商
           可选的"url"属性指定厂商的主页链接;
           可选的"email"属性指定厂商的电子邮件地址;
           可选的"logo"属性指定显示在欢迎界面插件名称旁边
           的大小为16x16的图标在插件JAR中的地址 -->
      <vendor url="http://www.jetbrains.com" email="support@jetbrains.com" logo="icons/plugin.png">Foo Inc.</vendor>
    
      <!-- 此插件所依赖的插件唯一标识符 -->
      <depends>MyFirstPlugin</depends>
    
      <!-- 可选的插件依赖
           如果安装了ID为"MySecondPlugin"的插件,
           文件mysecondplugin.xml(格式与plugin.xml文件相同)将会被加载 -->
      <depends optional="true" config-file="mysecondplugin.xml">MySecondPlugin</depends>
    
      <!-- 允许插件与系统帮助系统集成(JavaHelp格式)
           "file"属性指定插件目录下"help"子目录的JAR文件名
           "path"属性指定JAR文件内的helpset文件名 -->
      <helpset file="myhelp.jar" path="/Help.hs" />
    
      <!-- 插件与IDEA兼容的最小和最大版本 -->
      <idea-version since-build="3000" until-build="3999"/>
    
      <!-- 包含插件描述、操作名称等文本资源将会被加载 -->
      <resource-bundle>messages.MyPluginBundle</resource-bundle>
    
      <!-- 插件应用级组件 -->
      <application-components>
        <component>
          <!-- 组件接口类 -->
          <interface-class>com.foo.Component1Interface</interface-class>
    
          <!-- 组件实现类 -->
          <implementation-class>com.foo.impl.Component1Impl</implementation-class>
        </component>
      </application-components>
    
      <!-- 插件项目级组件 -->
      <project-components>
        <component>
          <!-- 接口和实现类相同 -->
          <interface-class>com.foo.Component2</interface-class>
    
          <!-- 如果"workspace"选项设置为"true",组件会将其状态保存到.iws文件而不是.ipr文件
              注意<option>元素尽在组件实现了JDOMExternalizable接口时有效 -->
          <option name="workspace" value="true" />
    
          <!-- 如果存在"loadForDefaultProject"标签,项目级组件还会为默认项目实例化 -->
          <loadForDefaultProject>
        </component>
      </project-components>
    
      <!-- 插件模块级组件 -->
      <module-components>
        <component>
          <interface-class>com.foo.Component3</interface-class>
        </component>
      </module-components>
    
      <!-- 操作 -->
      <actions>
        <action id="VssIntegration.GarbageCollection" class="com.foo.impl.CollectGarbage" text="Collect _Garbage" description="Run garbage collector">
          <keyboard-shortcut first-keystroke="control alt G" second-keystroke="C" keymap="$default"/>
        </action>
      </actions>
    
      <!-- 插件定义的扩展点
            扩展点由插件注册,以便其他插件可以为此插件提供某些数据
            “beanClass”属性指定可以用于扩展点的实现类 -->
      <extensionPoints>
        <extensionPoint name="testExtensionPoint" beanClass="com.foo.impl.MyExtensionBean"/>
      </extensionPoints>
    
      <!-- 插件为IDEA核心或其它插件定义的扩展点添加的扩展
           "defaultExtensionNs "属性必须设置为定义扩展点插件的ID,
           如果扩展点时IDEA核心定义的,则设置为"com.intellij" ;
           <extensions>标签内的标签名称必须与扩展点的名称匹配,
           "implementation"属性指定添加到扩展点的类名 -->
      <extensions xmlns="VssIntegration">
        <testExtensionPoint implementation="com.foo.impl.MyExtensionImpl"/>
      </extensions>
    </idea-plugin>
    

    相关文章

      网友评论

          本文标题:插件配置文件

          本文链接:https://www.haomeiwen.com/subject/jjvqbttx.html