Eclipse Simple plug-in development-startup time prompt

Source: Internet
Author: User

1. New Plug-in Project

Do not change other options, click "Next", then click "Finish" 2, New;ImportOrg.eclipse.jface.dialogs.MessageDialog;ImportOrg.eclipse.swt.widgets.Display;ImportOrg.eclipse.swt.widgets.Shell;ImportOrg.eclipse.ui.IStartup; Public classShowTimeImplementsistartup{@Override Public voidEarlystartup () {Display.getdefault (). Syncexec (NewRunnable () {@Override Public voidrun () {LongEclipsestarttime = Long.parselong (System.getproperty ("Eclipse.starttime")); LongCosttime = System.currenttimemillis ()-Eclipsestarttime; Shell Shell=Display.getdefault (). Getactiveshell (); String message= "Eclipse Startup time:" + costtime + "MS"; Messagedialog.openinformation (Shell,"Information", message);    }                    }); }    }

3, New Plugin.xml Right-click Project, tap New File, enter Plugin.xml

Add Content:
<?XML version= "1.0" encoding= "UTF-8"?><?Eclipse version= "3.4"?><plugin>   <extension Point= "Org.eclipse.ui.startup">         <Startupclass= ""/>   </extension></plugin>

4. Revise to change the Bundle-symbolicname to: ";singleton:=true" 5, Test run right-click Project, run as---Eclipse application 6, export to jar package right-click Project, Export->deployable plug-ins and fragments Select Directory , it should be noted that to select the Eclipse directory, do not select the plugins directory, because it will default to $directory/plugins 7, restart eclipseerrors that may occur:1, export times Chinese garbled:

Workaround: Add a Line "javacdefaultencoding" in = UTF-8 "2, out of the jar package is missing plugin.xml do not know why, my package does not include plugin.xml, this problem puzzled me for a long time, accidentally opened the jar package to see just know. Workaround: Just copy the plugin.xml into the jar pack.

Available for download:

Eclipse Simple plug-in development-startup time prompt

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: 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.