Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Currently you can click on the id of a bean and view the definition of the bean (as long as the bean is defined in the current page. I would like to be able to do the same type of thing, but with any Spring config file in my project.

      I would also like to be able to click on the "class" attribute in the bean tag, and be able to view the class that's being referred to.

      – Configuration Details –
      Product: SpringSource Tool Suite 2.8.0.201108101000-M1 (com.springsource.sts.ide)
      Installed Features:
      com.springsource.sts 2.8.0.201108101000-M1

      – Configuration Details –
      Product: SpringSource Tool Suite 2.8.0.201108101000-M1 (com.springsource.sts.ide)
      Installed Features:
      com.springsource.sts 2.8.0.201108101000-M1

        Activity

        Hide
        Martin Lippert (c) added a comment -

        Did you try the hyperlinking feature? When you move the mouse over the class of a bean definition, for example, while holding down the alt/option/command key (depending on your OS), the class name becomes a hyperlink. When you click on that, you are directly navigated to the class definition. The same is possible for bean ids, also across different config files. This is basically the same that JDT provides within the Java editor. Is this what you mean?

        Show
        Martin Lippert (c) added a comment - Did you try the hyperlinking feature? When you move the mouse over the class of a bean definition, for example, while holding down the alt/option/command key (depending on your OS), the class name becomes a hyperlink. When you click on that, you are directly navigated to the class definition. The same is possible for bean ids, also across different config files. This is basically the same that JDT provides within the Java editor. Is this what you mean?
        Hide
        Mark Fortner added a comment -

        This works for beans defined in the current xml document. It doesn't work for beans that are defined elsewhere in your project.

        Also, the same mechanism doesn't work when you click on the value of the "class" attribute.

        Show
        Mark Fortner added a comment - This works for beans defined in the current xml document. It doesn't work for beans that are defined elsewhere in your project. Also, the same mechanism doesn't work when you click on the value of the "class" attribute.
        Hide
        Mark Fortner added a comment -

        It would also be useful, if I could expand a classname into it's fully qualified classname in the Spring bean editor. For example, if you type in class="MyBean" and press the Control-Spacebar it should expand MyBean into "com.whatever.MyBean", or allow you to select from a list of all MyBean definitions found in the classpath.

        Show
        Mark Fortner added a comment - It would also be useful, if I could expand a classname into it's fully qualified classname in the Spring bean editor. For example, if you type in class="MyBean" and press the Control-Spacebar it should expand MyBean into "com.whatever.MyBean", or allow you to select from a list of all MyBean definitions found in the classpath.
        Hide
        Martin Lippert (c) added a comment -

        Hey Mark!

        This is very strange, since all this is implemented as part of the config file editor.
        Can you please check:

        • is the spring xml configuration file that you are editing opened in the Spring Config Editor?
        • is the project configured as a Spring project? (has the Spring nature on it)

        Regarding the multiple config files: Are you talking about multiple Spring xml config files? If so, how do they reference each other? Via config sets or via import statements? If they have no relationship to each other (defined in either of these two ways), beans from the other files won't show up in auto-completion and navigation.

        If this all doesn't help, can you attach a screenshot showing the problem? Maybe I can see on that what is going wrong.

        -Martin

        Show
        Martin Lippert (c) added a comment - Hey Mark! This is very strange, since all this is implemented as part of the config file editor. Can you please check: is the spring xml configuration file that you are editing opened in the Spring Config Editor? is the project configured as a Spring project? (has the Spring nature on it) Regarding the multiple config files: Are you talking about multiple Spring xml config files? If so, how do they reference each other? Via config sets or via import statements? If they have no relationship to each other (defined in either of these two ways), beans from the other files won't show up in auto-completion and navigation. If this all doesn't help, can you attach a screenshot showing the problem? Maybe I can see on that what is going wrong. -Martin
        Hide
        Mark Fortner added a comment -

        Hi Martin,
        I have one project that has a Spring nature associated with it, and it has a .springBeans file – and the hyperlinking works there. I have another project that does not have a Spring nature and even though the XML files are Spring config files, and the Spring config editor opens the files and works on them, the hyperlinking does not work. When I added the Spring nature to the second project and refreshed it, it did not create a .springBeans file, and the hyperlinking still does not work. I don't know if the latter two events (.springBeans + hyperlinking) are related.

        One other thing to note, the second project is a parent project, and doesn't include the Spring config files in the build path. They're files that get deployed as part of the maven build. It may be that only files that are in the build path are navigable.

        In a third project, I have some Spring config files in a Java project. The project has both Maven and Java natures. I add the Spring nature to it, and the Spring config files located in the path now seem to be navigable. When I Control+Hover over a class attribute it gives me the option of navigating to the class.

        Hope this helps,

        Mark

        Show
        Mark Fortner added a comment - Hi Martin, I have one project that has a Spring nature associated with it, and it has a .springBeans file – and the hyperlinking works there. I have another project that does not have a Spring nature and even though the XML files are Spring config files, and the Spring config editor opens the files and works on them, the hyperlinking does not work. When I added the Spring nature to the second project and refreshed it, it did not create a .springBeans file, and the hyperlinking still does not work. I don't know if the latter two events (.springBeans + hyperlinking) are related. One other thing to note, the second project is a parent project, and doesn't include the Spring config files in the build path. They're files that get deployed as part of the maven build. It may be that only files that are in the build path are navigable. In a third project, I have some Spring config files in a Java project. The project has both Maven and Java natures. I add the Spring nature to it, and the Spring config files located in the path now seem to be navigable. When I Control+Hover over a class attribute it gives me the option of navigating to the class. Hope this helps, Mark
        Hide
        Martin Lippert (c) added a comment -

        Hey Mark!

        Thanks for the further details. The .springBeans file is not related to the hyperlinking and having the config files on the build path should also not influence the hyperlinking. Can you check if the config files are configured as config files for the project where is it not working (right click on the project -> Properties -> Spring -> Beans Support)? They should show up there in the list. If not, you could add them manually or by clicking "Scan"...

        -Martin

        Show
        Martin Lippert (c) added a comment - Hey Mark! Thanks for the further details. The .springBeans file is not related to the hyperlinking and having the config files on the build path should also not influence the hyperlinking. Can you check if the config files are configured as config files for the project where is it not working (right click on the project -> Properties -> Spring -> Beans Support)? They should show up there in the list. If not, you could add them manually or by clicking "Scan"... -Martin
        Hide
        Mark Fortner added a comment -

        Hi Martin,
        Thanks for the tips on using the Scan feature. I didn't know you could do that. I gave it a try but it resulted in other problems which I think probably have more to do with the way we have our project configured than with Spring itself. We use a master project. We import this project into STS. This master project has no src directories, but merely contains all subprojects. It also gives us access to all of the resources (including the Spring config files).

        Each subproject is imported as a separate project. These subprojects, can either be their own mini project, or contain subprojects. This is the standard maven project layout.

        Because of this project structure, the Spring config files are only accessible through the master project. Since the master project doesn't know anything about the classes defined in the subprojects, when I turn on Beans Support using the method you described previously, each Spring Config file shows up in red (error condition). It says that it can't find the class referred to in the bean tag.

        My guess is that the only way around this would be to move our Spring config files into a project and import the project. Which we may end up having to do anyway.

        Thanks for your help,

        Mark

        Show
        Mark Fortner added a comment - Hi Martin, Thanks for the tips on using the Scan feature. I didn't know you could do that. I gave it a try but it resulted in other problems which I think probably have more to do with the way we have our project configured than with Spring itself. We use a master project. We import this project into STS. This master project has no src directories, but merely contains all subprojects. It also gives us access to all of the resources (including the Spring config files). Each subproject is imported as a separate project. These subprojects, can either be their own mini project, or contain subprojects. This is the standard maven project layout. Because of this project structure, the Spring config files are only accessible through the master project. Since the master project doesn't know anything about the classes defined in the subprojects, when I turn on Beans Support using the method you described previously, each Spring Config file shows up in red (error condition). It says that it can't find the class referred to in the bean tag. My guess is that the only way around this would be to move our Spring config files into a project and import the project. Which we may end up having to do anyway. Thanks for your help, Mark
        Hide
        Martin Lippert (c) added a comment -

        Can you create a sample project setting for me? Would be nice to take a look to see what we could possibly do in the future to support this kind of layout better than today.

        Show
        Martin Lippert (c) added a comment - Can you create a sample project setting for me? Would be nice to take a look to see what we could possibly do in the future to support this kind of layout better than today.

          People

          • Assignee:
            Unassigned
            Reporter:
            Mark Fortner
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              First Response Date: