Spring Bean Support

Posted on by etienne

IntelliJ IDEA is aware of the Spring beans that are part of your project. If you apply Find Usages on a property setter method, for example Customer#setLastName(), and there is a Spring bean of the matching type and with the matching property being declared in a Spring XML file, IntelliJ IDEA will find it and will properly list it as a usage.

IntelliJ IDEA also respects Spring bean definitions during Safe Delete actions. On a side note, it does not make a difference whether Find Usages, Safe Delete, Rename Method, etc. are applied on the property setter method in the Java code or on the property attribute value in the Spring XML file.
You can also apply Goto Declaration (Ctrl-B or middle-button mouse click) on the name attribute’s value in the Spring XML file, for example on lastname, and IntelliJ IDEA will take you to the property setter method in the Java code.

Technorati tags: , , ,
Comments below can no longer be edited.

4 Responses to Spring Bean Support

  1. John Childress says:

    July 10, 2006

    I’m not sure if this is a feature of the Spring Bean Support or of the xml editor, but I noticed the other day when i was editing my “beans.xml” file the following:
    1. intellisense for the value of the class attribute of a bean element.
    2. When I added property elements under the bean, I was again given intellisense for the available properties of the class.

    Not sure which part of the ide this comes from, but I love it. Thanks again for making it such a please to develop 🙂

    John

  2. Davide Baroncelli says:

    July 11, 2006

    Unfortunately the spring stuff is pretty much half-baked as of 5.1.2. Let’s hope it gets better in 6.0 (it should, as they’ve scheduled some of my feature requests). It’s sad that the only commercial plugin regarding spring (idea-spring) is of too low quality (although I bought 5 copies of it, hoping to contribute to the development of a good plugin).

  3. amokila says:

    July 11, 2006

    IdeaSpring v1.3-EAP adds FindUsages for bean’s.
    IdeaSpring v1.2 already have validation support, inspections, intentions, refactorings, auto-completion, a bean browser and much more.

    Just released v1.3-EAP2 (http://www.yanaware.com/ideaspring/eap.php) now works with SpringFramework 2.0rc2, adds graph of beans for a config file and a “Generate Bean Dependency” action.

    Let’s judge by yourself if, as Davide told us, IdeaSpring is of too low quality.

  4. Davide Baroncelli says:

    August 18, 2006

    Well, let’s put it like that: I’m a customer of your plugin, and I’m not satisfied.

    I wonder if now ideaspring supports factory beans, which is one of its major problems, as of 1.2 (and surely something I would have worked on before adding a bean factory grapher, which is something absolutely non idea-ish and generally unuseful: the struts assistant has had one for months, I used it twice just for the fancy of it and then reverted to use its much useful navigation aids…). I’m afraid not, since my bug report has remained unresolved: http://www.jetbrains.net/jira/browse/YWSPR-52

    Ideaspring 1.2 indeed IS of too low quality for serious spring work, mainly for that, and because its multi-module support is non-existing: so if one has beans with similar names in different modules of the same project, ideaspring messes with them all, not recognizing they are in different config sets.

    I hope 1.3 is better (and it won’t oblige me to re-copy the jar into the idea lib directory every time I install a new idea update ), but up until now none of our 5 licenses is really being used for any serious work: the only “feature” ideaspring really added to our project is (wrong, of course) underlining in red of every reference to a bean issued from a factory.

Subscribe

Subscribe for updates