Results 1 to 5 of 5
Thread: Feature Location
- 10-29-2011, 11:18 PM #1
Member
- Join Date
- Oct 2011
- Posts
- 7
- Rep Power
- 0
Feature Location
Hello everyone.
Can somebody provide me a good way of implementing feature location in programs.
Let's say that I am developing a simple Java GUI application. I want to find the corresponding code when I point out with the mouse to one of the objects in the GUI, ex there is a Save button, and I want to get the code where the button does something.
I would appreciate if somebody knows any implementation of a tool that does this. Thank you for your consideration.
- 10-30-2011, 02:43 AM #2
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,537
- Rep Power
- 11
Re: Feature Location
There is, in general, no way of knowing.ex there is a Save button, and I want to get the code where the button does something.
What the save button actually does will depend on the details of foo's actionPerformed() method. As mentioned this other class may not have been written yet, or its source may not be available. In addition there may be many such event handlers so that "the code where the button does something" is not straight forward.Java Code:// in some class JButton saveBut = new JButton("Save"); public JButton getBut() {return saveBut;} // in some other class *not even written yet* someClass.getBut().addActionListener(foo);
Some IDEs offer a feature like this, but they do it by constraining the code to fit a predetermined - "do not edit below this line" - pattern.
- 10-30-2011, 10:43 AM #3
Member
- Join Date
- Oct 2011
- Posts
- 7
- Rep Power
- 0
Re: Feature Location
Probably the example with the button was not a good one.
Let's say that there is a label that displays some text and by pointing to the label I want to find the code that writes a text to that label.
- 10-30-2011, 10:42 PM #4
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,537
- Rep Power
- 11
Re: Feature Location
It's the same deal: the label exposes a setText() method, and that method can be called from anywhere that has a reference to the label.
- 10-30-2011, 11:01 PM #5
Similar Threads
-
Java Feature Location
By asterix5 in forum Advanced JavaReplies: 1Last Post: 10-30-2011, 02:50 AM -
need to copy file from one location to another location
By naveen.dpt2007 in forum New To JavaReplies: 4Last Post: 02-28-2010, 03:53 PM -
location provider returns no location
By sandeeprao.techno in forum CLDC and MIDPReplies: 0Last Post: 09-24-2009, 09:54 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks