How to run plugin code in Eclipse automatically on startup?(如何在启动时自动在 Eclipse 中运行插件代码?)
问题描述
我想创建一个在用户打开 Eclipse IDE 后自动在后台运行的 Eclipse 插件.
I want to create an Eclipse plugin that automatically runs in the background, as soon as the user opens the Eclipse IDE.
例如,我正在构建一个获取当前活动文件地址的 Java Eclipse 插件,但我希望该插件始终在后台运行,而无需用户手动运行.
For example, I am building a Java Eclipse plugin that gets the current active file address, but I would like this plugin to always run in the background without user having to run it manually.
如何做到这一点?
推荐答案
org.eclipse.ui.startup 扩展点允许您定义一个在工作台初始化期间提前运行的类.
The org.eclipse.ui.startup extension point lets you define a class that is run early during workbench initialization.
扩展点看起来像:
<extension point="org.eclipse.ui.startup">
<startup class="package.StartupClass"/>
</extension>
指定的类必须实现org.eclipse.ui.IStartup接口.
the class specified must implement the org.eclipse.ui.IStartup interface.
更多细节 这里
这篇关于如何在启动时自动在 Eclipse 中运行插件代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在启动时自动在 Eclipse 中运行插件代码?
基础教程推荐
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- RabbitMQ:消息保持“未确认"; 2022-01-01
- 修改 void 函数的输入参数,然后读取 2022-01-01
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
- 使用堆栈算法进行括号/括号匹配 2022-01-01
- 存储 20 位数字的数据类型 2022-01-01
- 如何对 Java Hashmap 中的值求和 2022-01-01
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
- Struts2 URL 无法访问 2022-01-01
