We have some class files with globs of redundant code. I’ve been looking for a view in Eclipse which allows you to limit your editor to just a single method, similar to Module View button in VB6, for those of you who know what I mean. The need for this is to make it easier to search for a string and have the search limited to only the code within the method I care about. (It’s also a nice feature for editing large globs of code, to make sure I am not accidentally adding the code to a different large method with redundant code.)
I thought the Declaration View would do this, but this view neither allows search nor editing. This leads to a 2-part question:
a. This there any view in Eclipse that can be used as described above?
b. Given Declaration View’s limitations, what is it useful for? (The only link I found directly Declaration View Hands On Eclipse didn’t make much sense to me.)
a) Go to
Window > Preferences > Java > Editorand selectShow only selected Java element.I believe that’s what you want 🙂 This way you can use the
Outline Viewto navigate throughout the members of the class.b) The
Declaration Viewis just a quick reference about: