Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Tools / July 2006

Tip: Looking for answers? Try searching our database.

eclipse: pluging for variable/function name replacement

Thread view: 
kayoux@hotmail.com - 16 Jun 2006 16:02 GMT
Hi,

Is there a plugin that would enable me to change all occurrences of a
variable/function name in a software project?

I mean I see that I can change a variable name in one file at time,
selecting each one.

I also saw that there's a org.eclipse.core.variables package that could
help to do so.. but I believe I have to write my own code.

I want a plugin that will take as arguments all the names I want ot
change or a certain type (say all globals or functions) and change them
all given a pattern.

Is there something already done for this?

Thank you,

Yvan
Roland de Ruiter - 16 Jun 2006 17:31 GMT
> Hi,
>
[quoted text clipped - 16 lines]
>
> Yvan

Maybe you're looking for something else, but in Java projects you can
use the rename refactoring to rename a variable/method/type throughout
your project.

Select the variable/method/type by clicking on it. Then right-click and
choose Refactor > Rename from the popup menu. Alternatively, use the
keyboard shortcut Alt+Shift+R.

Refactor > Rename and Refactor > Move also works for files in the
package explorer.
Signature

Regards,

Roland

kayoux@hotmail.com - 04 Jul 2006 17:11 GMT
Ok thanx.

Can this be done automatically for all, say, global variables and
function names? I would like to have an automatic procedure that does
so. When you say Java projects, do you assume I'm coding in Java? I'm
using Eclipse, which was built in Java, but I don't code in Java at all
(I code in Embedded C).

I've solved the problem using linux commands, such as sed and awk. I
don't find the solution very attractive in the long-term though.

Thank you very much.

Yvan
> > Hi,
> >
[quoted text clipped - 27 lines]
> Refactor > Rename and Refactor > Move also works for files in the
> package explorer.
Stephan Titard - 06 Jul 2006 13:38 GMT
kayoux@hotmail.com escribió:
> Ok thanx.
>
[quoted text clipped - 41 lines]
>> Refactor > Rename and Refactor > Move also works for files in the
>> package explorer.

actually changing a name in a group of files is not an easy task
supposing you can actually parse the the program, and from that analisis
change the given name, you still have to parse the comments which are
essentially format-free: a tough task to say the least
probably worth to do given the odds of such occurence...

hth
--stephan


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.