Spring Beans XML Editor

This XML editor aims to be a useful tool in editing and validating Spring BeansConfig files. Instead writing an XML editor from scratch BeansXmlEditor leverages the WebStandardTools subproject from the Eclipse WebToolsPlatform project. BeansXmlEditor will be released as part of Release 1.3. If you are looking for some documentation about the Editor visit BeansXmlEditorUsage?.

We will use this page to document the progress of the development and to encourage everybody to post a feature request to the bottom of the page or file a ticket.

Commited Features

  • Specialized outline view - 100%
    • Toolbar action for lexically sorting the outline view's tree nodes
    • Context menu item for switching outline view's visualization between "Spring Beans Config" and "Plain XML" mode
  • Specialized content assist
    • Uses information from the BeansCoreModel
    • Code completion for bean classes, properties and bean refs - 75%
  • Integration with Spring IDE BeansView and BeansGraph
  • Specialized template support
    • Pre-defined templates for creation of property, ref and bean tags as well as for common Spring beans like ProxyFactoryBean? - 75% refer to ticket #114
    • Specialized preference page for definition of custom templates - 75%

Detailed Features

Currently for the following elements of the spring-beans.dtd code completion features are planned:

  • alias
  • bean
    • class proposals from all classes from the project's classpath - 100% - (Screenshot)
    • parent attribute value proposals should be read from the current BeansConfig and all BeansConfigSets? -- 100%
    • depends-on attribute value proposals should be read from the current BeansConfig and all BeansConfigSets? -- 100%
    • init-method and destroy-method proposals for all methods having zero arguments from the beans' class - 100% - (Screenshot)
    • factory-method proposals for all static void methods from either the beans' class or the class definied by the factory-bean reference - 100% - (Screenshot) or (Sreenshot)
    • factory-bean bean id proposals from the current BeansConfig and all BeansConfigSets?' -- 100%
  • property
  • lookup-method
    • name proposals for all methods having zero arguements from the beans' class
    • bean bean id proposals from the current BeansConfig and all BeansConfigSets?

replaced with screenshoot from upcoming editor of v1.2.5

Requirements

BeansXmlEditor has very strict requirements:

WST introduces its own strict requirements:

  • EMF
  • JEM

Feature Requests

Feel free to add your requests

  • I don't have enough knowledge of Eclipse plug-in development to know the feasibility or complexity of doing some of these, so some may be too ambitious for the next release, but here are a few suggestions:
    • Implement the display of the error message when hovering over the error indicators in the editor, so that you don't have to look at the Problems view to see what's wrong. That is already built-in the Eclipse platform using IMarker implementations.
      • note from original requestor: I've never seen this functionality work in any verion of SpringIDE under any version of Eclipse
        • note from Torsten - works for me -> please refer to attached screenshoots (Screenshot) or (Screenshot) ;-)
          • OK, I now have Eclipse 3.1 and Spring IDE 1.2.1 installed, and the hover does indeed work. I guess my previous experiences were just due to minor incompatibilites between certain versions of Eclipse and Spring IDE.
    • Add a context menu item to the editor to generate property and/or constructor-arg XML for the current bean definition class, similar to how the Java editor can generate getters and setters, as well as delegate methods. Allow me to check off those properties for which I want to generate code. - Refer to ticket #228
    • If possible, the editor should register itself as a listener to changes in the project's Java classes, and update the error indicators in real-time instead of just after a save to the XML.
    • If you want to get really ambitious, you could add some Java refactoring support for doing things like Replace 'New' instantiation with Spring 'getBean', Replace factory method call with Spring 'getBean', etc. Extra points for
      • Offering to perform an Extract Interface refactoring, if necessary
        • Can you add more specific information on this, please
          • After giving this more thought, nevermind. It could get ridiculously complex without really providing that much benefit.
      • Offering to create the corresponding bean definition XML
  • CTRL-Click for navigation:
    • CTRL-click on a bean definition id or name - start a new search to show 'where is this bean refrenced'. to allow navigation to the definition of a refrencing bean. - I pretty much like the request. Opened ticket #227 for that.
    • CTRL-click on property ref name, or parent bean name, should navigate within the xml file to the bean definition
    • CTRL-click on classname or property name should navigate to the source class (or javadoc class for jars) at the relevant point - 100% refer to ticket #108
  • CTRL-SHIFT-C - this used to work in earlier versions of the Spring IDE, but since 1.3.2 it does not seem to work any more. CTRL-SHIFT-/ and CTRL-SHIFT-\ still works though. - This depends on your keybinding or the version of WebStandardTools you're using. Please check with a plain XML file not associated with a SpringProject.
  • How about a UML Object diagram for a design view?
  • ...

Another idea

  • when you are typing in properties it would be nice to have a look up of the available properties on the bean. For example, if you had typed <property name=""> and had your cursor inside the quotes it would be nice to be able to ctrl-space and get a list of the properties you can set on the bean. Maybe also add into the xml a value="" or a ref="" depending on the type of the property you select. This might be covered by your "Code completion for bean classes, properties and bean refs" section above, thought I would add anyway just in case. This feature is already implemented. Please see attached Screenshot

File/New

  • Why not a bean config XML file as one of the file types under File/New?

Attachments