<?xml version="1.0" encoding="UTF-8"?><?eclipse version="3.4"?><plugin> <extension point="org.eclipse.ui.startup"> <startup class="test4.actions.ShowTime"/> </extension></plugin>
package test4.actions;import org.eclipse.jface.action.IAction;import org.eclipse.jface.viewers.ISelection;import org.eclipse.swt.widgets.Display;import org.eclipse.swt.widgets.Shell;import org.eclipse.ui.IStartup;import org.eclipse.ui.IWorkbenchWindow;import org.eclipse.ui.IWorkbenchWindowActionDelegate;import org.eclipse.jface.dialogs.MessageDialog;public class ShowTime implements IStartup { @Override public void earlyStartup() { Display.getDefault().syncExec(new Runnable(){ @Override public void run() { long eclipseStartTime = Long.parseLong(System.getProperty("eclipse.startTime")); long costTime = System.currentTimeMillis() - eclipseStartTime; Shell shell = Display.getDefault().getActiveShell(); String msg = "Eclipse 启动耗时: " + costTime + "ms"; MessageDialog.openInformation(shell, "Information", msg); } }); } }
1 楼 dallarwww 2012-08-21
请问你是怎么打的包,jar包放在哪了,为什么我的没有反应?谢谢
2 楼 Tristan_S 2012-08-28
jar包上传了