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 .

 

eclipse插件开发学习笔记源码是指记录学习eclipse插件开发过程中的笔记所对应的源代码。在学习eclipse插件开发时,我们通常会通过写笔记的方式记录自己的理解、遇到的问题以及对应的解决方案。而这些笔记所涉及的源码,就是指在实践过程中编写的相关代码。 在学习eclipse插件开发时,源码是非常重要的,因为它直接反映了我们对于插件开发知识的理解和实践能力。一般而言,我们的源码应该包含以下几个方面的内容。 首先,源码应该包括插件的基本结构和配置信息。这包括插件的manifest.mf文件和plugin.xml文件。manifest.mf文件用于定义插件的基本信息,包括插件的名称、版本号以及对其他插件的依赖关系等。而plugin.xml文件则用于定义插件的扩展点和扩展。 其次,源码应该包括对于eclipse平台核心概念的理解和应用。例如,我们可以编写代码来创建和管理视图、编辑器、菜单、工具栏等界面元素,以及定义和处理事件等。 另外,源码还应该包含对于第三方插件的使用和扩展。eclipse插件生态系统非常丰富,我们可以通过使用第三方插件来快速实现一些功能。比如,我们可以使用JFace、SWT等第三方库来创建复杂的UI界面,使用EMF来定义和管理领域模型等。 总之,eclipse插件开发学习笔记的源码应该是一个不断积累和完善的过程。通过编写源码,我们可以更好地理解和掌握eclipse插件开发的知识和技术,提高自己的实践能力。
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值