eclipse启动时间插件
来源:互联网 发布:黑客使用的linux发行版 编辑:程序博客网 时间:2024/04/28 04:40
Eclipse插件开发
1. 下载并安装jdk和eclipse
这里强调一下: 需要下载Eclipse for RCP and RAP Developers, 否则无法新建Plug-in Development 项目.
2. 新建项目
安装好之后打开eclipse, 点击 File->NewProject。选择Plug-in Project,点击Next。新建一个名为com.developer.showtime的项目,所有参数采用默认值.
3. 在com.developer.showtime项目的src下新建一个类: ShowTime,代码如下:
package com.developer.showtime;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IStartup;
public class ShowTime implements IStartup {
public void earlyStartup() {
Display.getDefault().syncExec(new Runnable() {
public void run(){
long eclipseStartTime = Long.parseLong(System.getProperty("eclipse.startTime"));
long costTime = System.currentTimeMillis() - eclipseStartTime;
Shell shell = Display.getDefault().getActiveShell();
String message = "Eclipse start in " + costTime + "ms";
MessageDialog.openInformation(shell, "Information", message);
}
});
}
}
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IStartup;
public class ShowTime implements IStartup {
public void earlyStartup() {
Display.getDefault().syncExec(new Runnable() {
public void run(){
long eclipseStartTime = Long.parseLong(System.getProperty("eclipse.startTime"));
long costTime = System.currentTimeMillis() - eclipseStartTime;
Shell shell = Display.getDefault().getActiveShell();
String message = "Eclipse start in " + costTime + "ms";
MessageDialog.openInformation(shell, "Information", message);
}
});
}
}
4. 修改plugin.xml文件如下:
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.startup">
<startup class="com.developer.showtime.ShowTime"/>
</extension>
</plugin>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.startup">
<startup class="com.developer.showtime.ShowTime"/>
</extension>
</plugin>
5. 试运行
右键点击Run as -> Eclipse Application. 此时会运行一个eclipse, 启动之后就能显示启动所需时间.
6. 导出插件.
右键Export -> Deployable plug-ins and fragments. 在Directory中输入需要导出的路径, 点击finish后会在该目录下产生一个plugins的目录, 里面就是插件包: com.developer.showTime_1.0.0.201110161216.jar. 把这个包复制到eclipse目录下的plugin目录下. 然后再启动eclipse 便可以看到eclipse启动所花的时间.
0 0
- eclipse启动时间插件
- Eclipse启动时间插件(解决不能弹出问题)
- Eclipse启动找不到插件
- Eclipse启动计时插件
- Eclipse无插件启动Tomcat
- Eclipse无插件启动Tomcat
- Eclipse启动Tomcat时间过长
- eclipse插件开发初体验-eclipse启动耗时统计插件
- RCP 时间,日期插件eclipse nebula
- 通过Eclipse插件启动Tomcat的问题
- 通过Eclipse插件启动Tomcat的问题
- eclipse 安装插件后无法启动
- 启动Eclipse未加载插件,解决方法
- eclipse 启动重启加载插件
- eclipse插件启动Genymotion模拟器失败解决方案
- eclipse插件启动Genymotion模拟器失败解决方案
- eclipse插件启动Genymotion模拟器失败
- 启动Eclipse,Maven插件提示如下错误
- [Spark]Spark与Anaconda配置(Python)
- x86架构手机跑安卓好吗?
- 判别模型 和 生成模型
- 安卓应用反编译(二)-APK包反编译
- CSS经典操作
- eclipse启动时间插件
- 虫贵妃——开博纪念
- Lua和C++语言的交互详解
- Oracle varchar转clob
- awk用法
- 字符串的最小表示--nkoj2973质检员
- KMP算法
- css3中的边框相关样式
- 15、 EXTJs前后台交互