How to implement usages find for xml attribute?

Now If I press Alt+F7 in xml attribute, and IDEA give me "Cannot search for usages" error. I know Spring plugin has implemented this feature for bean usages find. How can I implement usages find for custom xml attribute? thanks.

5 comments

Now If I press Alt+F7 in xml attribute, and IDEA give me "Cannot search for usages" error. I know Spring plugin has implemented this feature for bean usages find. How can I implement usages find for custom xml attribute? thanks.


Do you mean attribute value with name of something? Then you should
associate PsiMetaData (see MetaRegistry) with the tag corresponding to
this something, and put a reference to the tag in the attribute value.
All your other references should also resolve to this tag.

0

yes, Peter, where can I find an example for reference?

0

I have a xml code as following:
]]>
and Java code as follwing:
client.queryForObject("select.user");
I make "select.user" attribute value refer to "select" tag, and make "select.user" parameter to reference to "select" tag. I press alt+f7 in "select.user", and find usage dialog appears, but IDEA report no usages found. Am I wrong with something?

Message was edited by:
linux_china

Message was edited by:
linux_china

0

Spring plugin uses this way to implement the feature? Any guy can give me a help? thank.


SpringApplicationComponent registers the MetaData. The self-reference is
registered by @Referencing annotation with SpringBeanIdConverter on
method DomSpringBean#getId()

0

Thanks, Peter, and I have implemented such feature. :)

0

Please sign in to leave a comment.