instance method references [message #148069] |
Wed, 10 March 2004 17:01 |
Eclipse User |
|
|
|
Originally posted by: chrismo.clabs.org
If I have:
public class MyForm
{
private Label lblA;
private Label lblB;
...
}
and I want to do a Java Search for all calls to lblA.setText(), how do I
do this? The default behavior, if I cursor to an instance of
lblA.setText and do a Workspace References search (Ctrl+Shift+G),
Eclipse searches for all instances of Label.setText, which would include
lblA.setText _and_ lblB.setText, not to mention every other
Label.setText call in the entire codebase (or the entire class, which is
painful if I have 17 label instances in the one class).
I tried doing a search on MyForm.lblA.setText and MyForm.lblA.setText*,
but both searches returned nothing.
Is there a way to do what I need?
(3.0.M7)
--
Chris
http://clabs.org
|
|
|
Re: instance method references [message #148079 is a reply to message #148069] |
Wed, 10 March 2004 18:23 |
Eclipse User |
|
|
|
Originally posted by: varavamu.yahoo.com
Chris Morris wrote:
> If I have:
>
> public class MyForm
> {
> private Label lblA;
> private Label lblB;
> ...
> }
>
> and I want to do a Java Search for all calls to lblA.setText(), how do I
> do this? The default behavior, if I cursor to an instance of
> lblA.setText and do a Workspace References search (Ctrl+Shift+G),
> Eclipse searches for all instances of Label.setText, which would include
> lblA.setText _and_ lblB.setText, not to mention every other
> Label.setText call in the entire codebase (or the entire class, which is
> painful if I have 17 label instances in the one class).
>
> I tried doing a search on MyForm.lblA.setText and MyForm.lblA.setText*,
> but both searches returned nothing.
>
> Is there a way to do what I need?
>
> (3.0.M7)
>
Note sure if this is the right way to do it, but if you need a quick
workaround:
Create an inner class or an anonymous class when assigning
(instantiating) your label, and override the setText() method, and
search for references.
I agree that this would be a good idea for a plugin/feature.
HTH,
Vijay
|
|
|
|
Powered by
FUDForum. Page generated in 0.03273 seconds