教你怎样扩展Eclipse的扩展点(二)

16 篇文章 0 订阅
16 篇文章 0 订阅

我们先新建一个 元素(New Element)名称为 extender,

这时有两个元素了,在第一个元素上点右键,在弹出的对话框中选择"序列",

再在这个新增的对象上右键新增一个 extender 对象。

在 extender 的明细页中将 最大边界选择为 无边界就行了。

接下来我们给 extender 元素增加属性,过程就省略了

 

上面是添加好的属性,注意其中的className属性

好了,扩展点就这样建好了,下面我将这个扩展点文件贴出来:

<?xml version='1.0' encoding='UTF-8'?>

<!-- Schema file written by PDE -->

<schema   targetNamespace= "TheMainMenuProject" >

<annotation>

       <appInfo>

          <meta.schema   plugin= "TheMainMenuProject"   id= "org.vwpolo.rcp.extender"   name= "RCP Extension Point" />

       </appInfo>

       <documentation>

         [Enter description of this extension point.]

       </documentation>

    </annotation>

    <element   name= "extension" >

       <complexType>

          <sequence>

             <element   ref= "extender"   minOccurs= "1"   maxOccurs= "unbounded" />

          </sequence>

          <attribute   name= "point"   type= "string"   use= "required" >

             <annotation>

                <documentation>

                  

                </documentation>

             </annotation>

          </attribute>

          <attribute   name= "id"   type= "string" >

             <annotation>

                <documentation>

                  

                </documentation>

             </annotation>

          </attribute>

          <attribute   name= "name"   type= "string" >

             <annotation>

                <documentation>

                  

                </documentation>

                <appInfo>

                   <meta.attribute   translatable= "true" />

                </appInfo>

             </annotation>

          </attribute>

       </complexType>

    </element>

    <element   name= "extender" >

       <complexType>

          <attribute   name= "id"   type= "string"   use= "required" >

             <annotation>

                <documentation>

                  

                </documentation>

             </annotation>

          </attribute>

          <attribute   name= "name"   type= "string"   use= "required" >

             <annotation>

                <documentation>

                  

                </documentation>

             </annotation>

          </attribute>

          <attribute   name= "type"   use= "required" >

             <annotation>

                <documentation>

                  

                </documentation>

             </annotation>

             <simpleType>

                <restriction   base= "string" >

                   <enumeration   value= "perspective" >

                   </enumeration>

                   <enumeration   value= "view" >

                   </enumeration>

                   <enumeration   value= "action" >

                   </enumeration>

                </restriction>

             </simpleType>

          </attribute>

          <attribute   name= "clientId"   type= "string"   use= "required" >

             <annotation>

                <documentation>

                  

                </documentation>

             </annotation>

          </attribute>

          <attribute   name= "index"   type= "string" >

             <annotation>

                <documentation>

                  

                </documentation>

             </annotation>

          </attribute>

          <attribute   name= "desc"   type= "string" >

             <annotation>

                <documentation>

                  

                </documentation>

             </annotation>

          </attribute>

          <attribute   name= "className"   type= "string" >

             <annotation>

                <documentation>

                  

                </documentation>

                <appInfo>

                   <meta.attribute   kind= "java"   basedOn= "org.eclipse.jface.action.Action:" />

                </appInfo>

             </annotation>

          </attribute>

       </complexType>

    </element>

    <annotation>

       <appInfo>

          <meta.section   type= "since" />

       </appInfo>

       <documentation>

         [Enter the first release in which this extension point appears.]

       </documentation>

    </annotation>

    <annotation>

       <appInfo>

          <meta.section   type= "examples" />

       </appInfo>

       <documentation>

         [Enter extension point usage example here.]

       </documentation>

    </annotation>

    <annotation>

       <appInfo>

          <meta.section   type= "apiInfo" />

       </appInfo>

       <documentation>

         [Enter API information here.]

       </documentation>

    </annotation>

    <annotation>

       <appInfo>

          <meta.section   type= "implementation" />

       </appInfo>

       <documentation>

         [Enter information about supplied implementation of this extension point.]

       </documentation>

    </annotation>

    <annotation>

       <appInfo>

          <meta.section   type= "copyright" />

       </appInfo>

       <documentation>

         

       </documentation>

    </annotation>

</schema>

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值