Customizing the Eclipse IDE's features (i)

Source: Internet
Author: User
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 
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.