Help needed with structural search

How can I structurally search for all calls to a JComponent constructor?
Examples: new JPanel(), new JTextField(20), new JButton(...), etc etc etc

I've tried
new $c$($p$)
where $p$ is minimum count 0 and maximum count unlimited
but i don't know how to define $c$ to be 'instanceof JComponent'
script constraint seems to be the way to go but there's no docs on how to use it

I'm using Idea8

thx
andy

2 comments
Comment actions Permalink

Text: JComponent
In type hierarchy: true

Andy Kriger wrote:

How can I structurally search for all calls to a JComponent constructor?
Examples: new JPanel(), new JTextField(20), new JButton(...), etc etc etc

I've tried
new $c$($p$)
where $p$ is minimum count 0 and maximum count unlimited
but i don't know how to define $c$ to be 'instanceof JComponent'
script constraint seems to be the way to go but there's no docs on how to use it

I'm using Idea8

thx
andy



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Comment actions Permalink

Thank you - that was easy. The docs make it sound like the search goes up the hierarchy ('If this option is selected, pattern matches are search not only in type names but also in parents (within the hierarchy)") not that the search goes down the hierarchy.

0

Please sign in to leave a comment.