Plug-in development for eclipse-startup time

Source: Internet
Author: User

The author has an eclipse-optimized chapter in the book on "Deep understanding of Java Virtual machines" this evening, which involves the development of plug-ins for Eclipse startup time detection

So turned over the information, but also developed a plug-in

It was started after development.

The start-up time is more than 13s, then I developed the process for everyone to reference

The first step creates a new plug-in project file

Generate an activator in the second step tick

The third step is to write a Showtime.java file

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{

@Override
public void Earlystartup () {
Display. Getdefault (). Syncexec (New Runnable () {

@Override
public void Run () {
TODO auto-generated Method Stub
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);
}

});
}

}

This is my own.

Found an error

Add one after bundle-symbolicname:com.developer.showtime; singleton:=true

Configuration under Plugin.xml

<?xml version= "1.0" encoding= "UTF-8"?>
<?eclipse version= "3.5"?>
<plugin>
<extension point= "Org.eclipse.ui.startup" >
<startup class= "Com.developer.showtime.ShowTime"/>
</extension>
</plugin>

You can now run as---eclipse application, which launches a new eclipse and runs the plug-in, and then you can export the plugin after success.

Do you want to make a plug-in like this? Give it a try.

Plug-in development for eclipse-startup time

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.