Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the NetBeans plug-in development and related background introduction?

2025-02-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail about NetBeans plug-in development and related background introduction, the content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

Do you want NetBeans to provide you with more functions?

You want to devote yourself to NetBeans plug-in development and hope it will inspire you to develop another application. You want to listen to music, browse the web, check email, store your favorite URL, and maintain daily tasks-all of which can be done within NetBeans. So, let's take a look at how to add all these required features?

NetBeans IDE is an environment based on NetBeans plug-in development. In other words, NetBeans has a modular architecture. To put it simply, we have a basic integrated development environment, and then we enrich its functionality by writing plug-ins to extend IDE. The NetBeans platform is such a basic IDE. Most of the functionality you see in NetBeans is implemented by these plug-ins.

NetBeans plug-in development module and related background

As the name implies, a NetBeans plug-in development module is a module that is inserted into NetBeans IDE to provide some specific functionality. The NetBeans plug-in may or may not have a graphical user interface. We have begun to better put the concept of plug-ins into practice, and I am sure you have installed more than one Mozilla Firefox plug-in to give you a better browsing experience.

See http://platform.netbeans.org/tutorials/nbm-glossary.html for basic terms.

NetBeans Platform: the backbone application, which provides everything most applications need, while what most applications don't need is not. NetBeans Platform provides common requirements for an application, such as menus, file management, and settings-- all out of the box. Building an application "on NetBeans" means not writing the application from scratch, but providing only the parts of the application that NetBeans Platform doesn't already have. At the end of the development cycle, you package your application with NetBeans Platform, saving a lot of time and effort and achieving a robust and reliable application.

System Filesystem: general registry that contains NetBeans configuration information built from the layer.xml configuration file of the registered module. NetBeans stores various configuration information in System Filesystem. For example, System Filesystem contains a Menu folder that contains a subfolder with names such as File and Edit. These subfolders contain files that represent the Java classes that perform the actions that appear in the File and Edit menus of IDE.

Module: a set of Java classes that provide applications with specific functions. The Java class uses the manifest.mf file to declare the module and the layer.xml configuration file to register their functionality in System Filesystem. In NetBeans terms, "plugin" is an adjective and "module" is a noun. There is no obvious semantic difference between the two.

NetBeans API: common interfaces and classes that are available to plug-in module writers. They are divided into specific application program interfaces (API) according to the types of functionality they provide. As specified in the API reference documentation, the content and behavior of the Java source package and its subpackages is API. For a full list of NetBeans application interfaces (NetBeans API List), click here.

Module Suite: a set of modules deployed together that depend on each other. IDE helps you mark the suite-- for example, you can add a splash screen, and you can specify a portion of the NetBeans platform that you don't want the application to provide.

* plug-ins developed by NetBeans plug-ins

You will now see how to write * plugins. What will the plug-in do? In addition to creating a "Start Page" tab in the editor, you can create another "tab".

No, it's not pretty enough, but it's enough to achieve the purpose of the demonstration: -)

Create a new module project

Create a new module project and name it "nbmodule-demo".

Select the Standalone Module option.

Basic module configuration

Code base (Code Name Base): replace 'myorghere'' with 'mymodule'' to get "org.mymodule.nbmoduledemo".

Module display name (Module Display Name): nb-module-demo

Localized bundling (Localizing Bundle): keep the default. The plug-in specifies that it is used to internationalize language-specific strings.

XML layer (XML Layer): keep the default. It registers items such as menus and toolbar buttons in NetBeans System Filesystem.

Click the Finish button.

The system generates the project code structure:

The backbone module is now ready. Next, we will add code for the specific tasks that we want the module to perform.

Add a "Window Component"

Right-click the 'org.mymodule.nbmoduledemo' option.

Select "New- > Window Component".

New window (New Window)

Window location (Window Position): "editor" to add a "tab" to the editor.

Select the Open on Application Start option.

Enter "AppUIMain" in the Class Name Prefix field.

You can select an icon if you like.

Click the Finish button.

Three new files have been added to the org.mymodule.nbmoduledemo project source package.

"AppUIMainTopComponent.java" is a file that determines the plug-in GUI. Switch to Design view.

Add a "Label", "Combo box", and "Button" respectively:

Now the plug-in is ready.

Load the plug-in module in NetBeans

Right-click the module project and select "Install/Reload in Target Platform".

A new instance of the NetBeans plug-in starts, and you can see the new "tab".

About the NetBeans plug-in development and related background introduction is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report