Detailed report plug-in debugging tutorials and report plug-ins debugging tutorials during development
Background
Currently, plug-in development and debugging are very troublesome. You need to modify the code, compile the class, and re-input the plug-in package. Delete the previous one and install the latest one. The process is complicated and cannot be debugged, which is inconvenient. Then I will teach you how to debug the plug-in.
Required tools:Eclipse, finereport report tool
Description
1. Create a project
Create a java project.
2. Add dependencies and start the designer.
Many jar packages are required to start the designer. The details are as follows:
A. jetty-related jar packages
B. jar packages related to the designer
C. Other related jar packages
Select jar package
3. Add the main function
The main function code is:
Import com. fr. start. Designer;
Public class MainFrame {
Publicstatic void main (String [] args ){
NewDesigner (args );
}
}
4. Start the designer.
The effect is as follows:
Note: There will be some errors, don't worry, this is caused by the lack of packages on which some plug-ins depend
For example, the problem is caused by the lack of text box ID card verification plug-in. If you have obsessive-compulsive disorder, you can add all plug-in-related packages.
5. Development plug-ins
Add the code to the project,
The Code of ActualLocaleFinder. java is:
Package com. fr. plugin. designer;
Import com. fr. stable. fun. impl. AbstractLocaleFinder;
Public class ActualLocaleFinder extends actlocalefinder {
@ Override
/**
* Return path
* @ Return same as above
*/
Public String find (){
Return "com/fr/plugin/designer/resource/locale/search ";
}
}
The code for SearchTemplateAction. java is:
Package com. fr. plugin. designer;
Import com. fr. base. BaseUtils;
Import com. fr. design. actions. UpdateAction;
Import com. fr. general. Inter;
Import javax. swing .*;
Import java. awt. event. ActionEvent;
/**
* Created by Administrator on 0022.
*/
Public class SearchTemplateAction extends UpdateAction {
Public SearchTemplateAction (){
// Configure the international file in search. properties
This. setName (Inter. getLocText ("FR-Designer_Template-Tree-Search "));
This. setSmallIcon (BaseUtils. readIcon ("/com/fr/plugin/designer/resource/search.png "));
}
@ Override
Public void actionreceivmed (ActionEvent e ){
JOptionPane. showMessageDialog (null, "This is Search Demo ");
// TemplateFileTree inherits the JTree. You can use setSelectedTemplatePath to select the template and traverse the JTree.
// TemplateFileTree tree = TemplateTreePane. getInstance (). getTemplateFileTree ();
}
}
The effect of the designer is as follows:
You can also perform debug debugging, such as adding breakpoints in the code.
If java debug is not used, you can use Baidu.
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.