Review above: Customizing the Eclipse IDE's interface chapter This article will document some of the Eclipse plug-in extensions (extension) and simply describe the usage of common extensions, but may not be so detailed. My main plug-in expansion is as follows: First, org.eclipse.ui.startup this expansion can be said to be critical, he can let us do some events at the time of Eclipse startup (and then a lot of small-function things to rely on it). XML configuration:
<extension
point= "Org.eclipse.ui.startup" >
<startup
class= "Com.bingo.start.BTStart" >
</startup>
</extension>
Corresponding implementation class:
public class Btstart implements IStartup
{public
Btstart () { } public
void Earlystartup () {
/ /extraneous UI code can be written here
job Job = new Uijob ("") {public
istatus runinuithread (Iprogressmonitor monitor) {
try {
// The code that touches the UI is written here, otherwise it will not work
} catch (Executionexception e) {
e.printstacktrace ();
return status.cancel_status;
}
return status.ok_status;
}
;
Job.schedule (300L); 300ms after execution
}
}
Second, Org.eclipse.ui.newWizards This is a guide to expand. Just like the new project, and then the next step. Here I used to do the new Application template project, in the wizard to expand the implementation of the application template generation. XML configuration:
<extension
point= "Org.eclipse.ui.newWizards" >
<category
id= "Bt_project"
name= "% Category.name ">
</category>
<wizard
category=" Bt_project "
class=" Com.bingo.perspective.ui.wizards.BTProjectWizard "
finalperspective=" com.bingo.ide.perspective "
icon=" Icons/eclipse16.png "
id=" Com.bingo.perspective.wizards.BTProjectWizard "
name="%projcet.name
" Project= "true" >
</wizard>
</extension>
Corresponding implementation class:
public class Btprojectwizard extends Wizard implements inewwizard{
The specific code does not show, Btprojectwizard is just a container, he also needs to add wizardpage in. You can also add the wizard extension to the right-click menu. The XML configuration is as follows:
<extension
point= "org.eclipse.ui.navigator.navigatorContent" >
<commonwizard
Associatedextensionid= "Org.eclipse.ui.navigator.resourceContent"
type= "new"
wizardid= " Com.bingo.perspective.wizards.BTProjectWizard ">
<enablement>
</enablement>
</ Commonwizard>
</extension>
Third, Org.eclipse.ui.menus add items separately in the menu bar. For example: I add a synchronization menu XML configuration:
<extension point=" Org.eclipse.ui.menus "> <menucontribution allpop
Ups= "false" locationuri= "Menu:help?before=org.eclipse.equinox.p2.ui.sdk.install" > <command
Commandid= "Com.bingo.perspective.ui.SyncHandler" label= "Sync bingotouch template" style= "Push" >
</command> </menuContribution> </extension> <extension point= "Org.eclipse.ui.commands" > <command defaulthandler= "Com.bingo.perspective.ui.handler.SyncHandler" id= "com.bingo.perspective . UI. SyncHandler "name=" sync bingotouch template > </command> </extension