Fast refactor on whole project

Hello, currently I am evaluating a trial copy of IntelliJ IDEA, it's great so far - I consider buying myself a license B-).
So far I am trying out IDEA with a project in which class count goes past 1K boundary, now i got a few guestions:
1. Is it possible to change one import statement across whole project? For eg. i've got a statement 'import java.util.logging.Logger' in a lot of classes and i would like to seamlesly change it to something else(some sort of refactor maybe)?

2. Also, is it possible to rename classes used in object initialization across whole project? For eg. Rename all usages of class named X to class named Y.

3. And the last question: is it possible to change all ocurence of method X in code with method Y - That is across whole project?

Thanks for answers in advance.

3 comments
Comment actions Permalink

Hi Eduard,

as long as your project is within Intellj you can change all of points you named.

For 1) you could use Structural Search, for other two, just use refactorings (rename)

@see:

http://www.jetbrains.com/idea/documentation/ssr.html
http://www.jetbrains.com/idea/features/refactoring.html

cheers
/m

0
Comment actions Permalink

Uhm, thank you for your suggestions, but i forgot to mention,that in case 2 and case 3, classes and methods are compiled in libraries(Refactoring does not work for me in this case...). Also, i can't get Structured replace to work - I'm getting errors, that no ocurences of my search pattern were found(though i am 100% that it is correct). Strange it is... Any ideas?



Attachment(s):
Screenshot-1.png
Screenshot.png
0
Comment actions Permalink

For #1 and #2, have a look at Refactor -> Migrate...

Hello, currently I am evaluating a trial copy of IntelliJ IDEA, it's
great so far - I consider buying myself a license
.

So far I am trying out IDEA with a project in which class count goes
past 1K boundary, now i got a few guestions:

1. Is it possible to change one import statement across whole project?
For eg. i've got a statement 'import java.util.logging.Logger' in a
lot of classes and i would like to seamlesly change it to something
else(some sort of refactor maybe)?

2. Also, is it possible to rename classes used in object
initialization across whole project? For eg. Rename all usages of
class named X to class named Y.

3. And the last question: is it possible to change all ocurence of
method X in code with method Y - That is across whole project?

Thanks for answers in advance.

---
Original message URL:
http://devnet.jetbrains.net/message/5299749#5299749



0

Please sign in to leave a comment.