Eclipse插件开发学习笔记(二)

弹出菜单 Pop-up Menus
1)MONKEY SEE/MONKEY DO RULE
 Always start by copying the structure of a similar plug-in.
 寻找相似的plug-in的方法
   通过查看现有文件中已经定义好的 extension points.
   Since the popupMenus extension point is defined by the org.eclipse.ui plug-in we open its plugin.xml file in   the manifest editor. On the Extension Points tab of the manifest editor we can see the extension points   defined in this plug-in and (more to our purpose here) where they are used.
   
2)关于plug-in.xml

<extension point="org.eclipse.ui.popupMenus">
  <objectContribution
    id="org.eclipse.contribution.junit.runtest"
    --当鼠标作选中的元素为“Type (classes and interfaces)”类型的时候才在popupMenus显示“Run Test”
    objectClass="org.eclipse.jdt.core.IType">
    <action
      id="org.eclipse.contribution.junit.runtest.action"
      label="Run Test"
      --鼠标只选中一个"Type"元素的时候才显示“Run Test”
      enablesFor="1"
      class="org.eclipse.compare.internal.AddFromHistoryAction">
    </action>
  </objectContribution>
</extension>

3)国际化
  Labels beginning with "%" will be used as a key into plugin.properties file. Replacing this file allows you to change the language of the plug-in .

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值