Sentence English proverb is called "Look Before You Jump", before the retrieval, look at this change in the influence of this change, is a good idea to decision-making is a good idea. 1. Viewing the definition program class is called each other, JBuilder can easily view the definition of classes, methods, value domains, placing the cursor on a certain code element, press Ctrl Enter shortcut or click the right button, in the pop-up Select Find Definition in the menu, and JBuilder will be positioned to the positioning of the element. 2, after viewing the reference class, method, the value domain is defined, it is referenced to the different places of the program, check the definition is like "swing roots", and the reference is just the opposite, that is, find all references from element definitions. The place. Place the cursor at the element definition, press Ctrl Shift Enter or by the menu that pops up by right-click, selection of Find References, JBuilder will list all the references in the project in the information pane, as shown below:
Figure 3 Reference results
The reference is organized in a tree, which is a specific reference in a group group. The following table lists the descriptions involved in the tree:
Table 2 Query reference structure icon description
Inquiry system 2) Type reference: Class declaration or class object instantiation of class declarations or class objects. 3) Inherit type reference: where the current class grandson or the place to reference these subclasses. 4) Members Quote: Members of the current class. 5) References of children and grandchildren: members of the current class grandson. Method, constructor 1) Declaration: The current method declaration. 2) Direct calls: Call through the class object instance. 3) Indirect call: Indirect calls through the parent class or sub-object instance. Value domain, local variable 1) Write: Change the value domain or local variable. 2) Read: Reading the value domain or the local variable.
In addition to view references within the scope of the project, you can also view reference relationships within the current class: Right-click on the element definition, select the Find Local References menu item in the pop-up menu.
3, check the coverage method
In the realization class of the subclass or interface, the cursor is positioned at the overlay method, right-click, select Find Overridden Method in the pop-up menu, and will be able to view the ancestry method covered by the current method.
The so-called distributed reconstruction is such a situation: A team develops a common module to form a JAR package to send it to other B, C and other teams. When A is reconstructed with the public module, the reconstruction information is attached to the JAR package. The groups of re-distribute, B, and C will apply these reconstructed information to their code through JBuilder. Distributed Reconstruction is undoubtedly a shining function that makes multi-team collaboration more freely, no distributed reconstruction, the source changes will become a bundle, with distributed reconstruction all Fan Dunnabel . Other reconstruction of miscellaneous JBuilder also provides many useful code reconstruction functions, such as optimizing the IMPORT statement, automatically add exception capture code blocks, reconstructing deployment description files, ejb reconstruction, proxy methods, etc. Footage. Of course, some refactors cannot be completed through tools, such as algorithm optimization design, database optimization design, etc., I am glad to this limitations, otherwise I will unemployment :). 2, the reconstruction dialog opens the Java file, move the cursor to the semantic code that needs to be reconstructed, and the reconstruction dialog box is called, as shown below is the dialog box for the package name:
Figure 1 Code Reconstruction Dialog
There is a corresponding dialog box, check the View References Before Refactoring item, after clicking the OK button, preview the reconstruction involved, the reconstruction preview window is shown below: Figure 2 Reconstructing Preview Window
If the View References Before Refactoring option of the reactor dialog is not checked, JBuilder completes the reconstruction, no user, click the button again. At preview, the package name in the editor still is the package name before unrequited, and the information pane lists the status of the impact, the "Rename Package MyRefactor to MyRefactor_1" of the first line of the information pane is refactored. Change the package name from MyRefactor to MyRefactor_1. Click the button to apply the button to apply the information pane. If you want to cancel, click the button at the bottom of the information pane to close the information pane. At this point JBuilder will pop up the dialog, prompting the user yet to be refactored, click Option to exit. If the click button is reconfigured, the reconstruction can be revoked by the button. Before you refactor, you should click the button to recoib to the file affected by the reconstruction to ensure that the Class file and Java file are synchronized. 3. Reconstructing the General Procedure Reconstruction General in JBuilder is generally performed at the following steps: 1. Compile the project to ensure synchronization of Java files and Class files. 2. Place the cursor in the required semantic code (such as package name, class name, method, value field, local variable), if you need to perform reconstruction, such as the extraction method, you also need to select a piece of code. 3. Tune the reconstruction dialog. JBuilder provides four ways to call reconstruction functions:. By the menu item under the Refactor main menu. Turn out the reconstructed floating menu via the Ctrl Shift R shortcut. Right-click in the editor, select Reconstruction menu items in the pop-up menu. Refactorned by the UML diagram. In addition, JBuilder also provides shortcuts for some common reconstruction functions, in the table below: Table 1 Reconstructing function item shortcuts
Shortcut button Reconstruction Function Ctrl Shift E Refining Method CTRL SHIFT V Introduction Variable Ctrl Shift C Automatic Add Exception Capture Code
note:
In addition to special cases, in addition to special cases, the reconstructed menu is called from the Ctrl Shift R shortcut, and then the reconstructed dialog box is called through the floating menu item. In order to keep the text's simpleness, like Ctrl Shift r-> Toner Floating Reconstruction Menu -> Select the Rename Method "XXX" menu item in the floating menu, call up the method Rename dialog, we will Description is: Ctrl Shift R-> Rename Method Tutoring Method Rename dialog.
4. The influence of reconstruction information and preview reconstruction through the report of the information pane.
5. Click the button to confirm the reconstruction.
6. Click on the Java file that the compiling reconstruction affects to keep the class file synchronization.
JBuilder regards each reconstruction as a transactional operation, assuming to rename a class, which will involve the change of the class name, the change of the constructor, the change of the class file name, the change of the caller reference, if a certain step is not Success, if the IO read-write problem occurs when the file name changes, all changes will not happen. This transactional operation makes it a good guarantee for the safety and integrity of the reconstruction.