Create your own Eclipse plug-in template-meet specific requirements by customizing existing templates

Source: Internet
Author: User

Introduction: If the default plug-in templates in Eclipse meet the needs of users, they can be very helpful. However, if the requirements go beyond the scope of the default template, you need to customize the template. This article discusses how to customize the plug-in project template in Eclipse, adjust the multi-section implementation and control in the template, improve ease of use by customizing the UI components, add input validation on the UI side, and explain how to automatically organize the directory structure of the plug-in project.

If you have ever created a plug-in project in Eclipse, you should familiarize yourself with the existing plug-in project templates, which can provide a convenient starting point for new projects. Existing plug-in templates can save a lot of time, but they are not everything.

One of the challenges with plug-in templates is finding templates that meet the needs of your users. However, templates provide only a limited number of features, and the user needs vary, and it is almost impossible for the developer who created the template to anticipate all the requirements in advance. In this case, customizing the template is an easy way to provide the user with the required plug-ins and to avoid writing plug-ins from scratch.

In this article, learn:

How to customize the plug-in project template in Eclipse.

Advanced features of templates, such as multi-sector implementation and control, UI component customization, and testing.

A tool that automatically organizes the project directory structure.

Prerequisite

This article is written for Java™ developers who are familiar with Eclipse and are interested in building plug-ins. This article assumes that the reader has a basic understanding of plug-ins and development tools based on Eclipse. To build the plug-in sample, you need to install Eclipse (V3.4 or later) and the Java Runtime Environment (JRE) on your computer.

The content here is based on the DeveloperWorks article "Building templates using the Eclipse Plug-in development environment". If you have not used a plug-in template, it is recommended that you read this article first, which describes how to create a template. Because this article is entry-level, the template it describes lacks the advanced features discussed in this article, including:

Multi-section implementation and control in general, each section of a plug-in template is defined as a functional module that contains interdependent files that have been built or generated based on user input. Files in one section are either copied to the target project or are no longer made. A user can define a section as required or optional. The files in the required section must be included in the plug-in project, and the files in the selection section should be copied according to the selection. If the plug-in template provides a superset of the functionality, but the project requires only a subset of the functionality, multiple extents implementation and control can be helpful. UI Component Customization Eclipse provides several default UI components for the plug-in project template. These basic UI components provide only limited functionality. To improve ease of use and functionality, it is sometimes necessary to customize complex components. Input validation This can enhance data validation control. The directory structure that automatically organizes plug-in projects can use templates to organize resources in a plug-in project into a specific directory structure. This can reduce the amount of manual work.

These extended features improve the scalability, ease of use, and efficiency of plug-in templates. In the following sections, we provide an example of a template that uses these features.

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.