In the above ( click here to review>> ), we mainly introduced some basic concepts of Spring, Spring project configuration and wizards. This chapter will continue to introduce how to manage multiple projects, Spring configuration editor, etc. Welcome to continue to pay attention~
MyEclipse v2023.1.2 offline version download (Q technical communication: 742336981)
4. Manage multiple Beans and projects
In addition to using the bean profile editor to manage Spring beans, you can also use the Outline view.
Spring Outline
You can also change the outline to a Spring-style outline using the Outline view menu.
Spring Explorer is a filtered tree view that displays all Spring projects in the workspace, along with any beans, configuration sets, and Spring Web Flow elements they may contain.
Spring Explorer view
The view is namespace aware and highly filterable and customizable. To customize a view, click the drop-down arrow on the View toolbar and select Customize View.
Customize filters and content in Spring Explorer views
Spring Explorer views also specifically annotate beans defined through Spring Java Configuration.
Spring Explorer Java configuration support
When seen in the Project Explorer view using the Spring perspective, all Spring projects contain a Spring Elements subproject. This project can be extended to display beans, configuration sets and web flow definitions, just like the Spring Explorer view described above. The ability to view a list of all beans that reference a specific Java class is a key feature.
Project Explorer with Spring Elements节点
As with Spring Explorer, the Spring elements displayed in this view can be filtered and customized, and you can also use a special Spring working set to reduce clutter in Project Explorer.
Spring work settings
The Graph viewer presents a graphical view of the relationships between the various beans in a given configuration file. Access the graphical view by clicking Beans Graph in the applicationContext.xml file editor.
Spring graphical editor
Use the Open Bean Wizard (ALT+Shift+B) or double-click the bean in the diagram to quickly navigate to any bean.
Navigate to bean
Perform various bean searches and pointcut matching in the workspace from the Search menu on the main toolbar.
Bean pointcut matching search
5. Spring configuration editor
The Spring Config editor is the default editor for Spring bean configuration files.
Spring configuration editor
In addition to standard XML support, Source views provide content assistance for classes, bean IDs, and properties.
Class content assistance
Bean content helper
Attribute content assistance
The Spring configuration editor also supports namespaces and provides intelligent content assistance and validation for defined elements.
AOP namespace content assist
P namespace content assist
Use the visual editor tabs to manage bean entities, editing namespace and bean details for each namespace selected in the configuration. Right-click on an element to add child elements and use the Element Details section to configure the element.
Using the visual Spring Bean configuration editor
To learn more details about the Spring Bean Configuration Editor, scroll to the bottom of the Element details section to access additional documentation.
Access other editor documentation
Renaming a Java class automatically changes the bean definition that references the class. Java classes can also be renamed directly from the bean configuration file.
Rename a bean's Java class
Bean IDs and properties can also be renamed. Renaming bean properties will change the corresponding Java class. The method of renaming an element is as follows:
- On the Beans tab of applicationContext.xml, select the element and edit the element details.
- In the Source view of applicationContext.xml, right-click the element and select Refactor>Rename Bean element from the menu.
- In the Source view of applicationContext.xml, place the cursor inside the element and press ALT+SHIFT+R.
Rename bean ID
Rename bean properties
In addition to standard XML validation, the editor performs spring-specific validations that can be controlled at the project and workspace level. Validation errors are logged in the profile Source view and detailed in the Problems view.
Verify customization
verify