Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-03-2007, 02:19 PM
mew mew is offline
Member
 
Join Date: Nov 2007
Posts: 70
mew is on a distinguished road
Renaming a class
I have a class in Eclipse. It has few constructor and objects of this class are being created in other classes. I now want to rename this class. How can I rename it in Eclipse so all its references are also changed accordingly.
Code:
public class Test { public Test(){ ... } public Test(int a){ ... } public Test(float a){ ... } }
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-06-2007, 11:44 PM
Member
 
Join Date: Dec 2007
Location: So Cal
Posts: 4
comando2929 is on a distinguished road
I'm not sure if there is a way to change all references that easiy. If it is a public class, you will need to rename the java file (eclipse will automaticly rename the class file to match), and just use the Find/Replace to change all the references.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 12-07-2007, 01:29 AM
Senior Member
 
Join Date: Nov 2007
Location: Newport, WA
Posts: 141
staykovmarin is on a distinguished road
If you right click on the class name > go to Refractor > Rename.
That will rename all the occurrences in the project (optionally even in comments).

Or press Alt+Shift+R
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
what is the Priority for execution of Interface class and a Abstract class Santoshbk Advanced Java 0 04-02-2008 09:04 AM
Renaming underlying directory in Java project Rodrigo Braz Eclipse 0 03-29-2008 03:30 AM
Renaming a method/variable gapper Eclipse 0 01-31-2008 03:29 PM
Accessing one class from another class through swing kbyrne AWT / Swing 5 01-03-2008 09:54 AM
Renaming a class in Eclipse Java Tip Java Tips 0 12-04-2007 12:54 PM


All times are GMT +3. The time now is 01:42 PM.


VBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org