Change all references to Label to JLabel across all project

Hi, I just want to know if intellij has some class of refactoring that allows us to migrate from a class to another, with a similiar interface (because they both share the Component parent)

Thank you.

5 comments
Comment actions Permalink

Hello Jaime,

Structural Search & Replace will help you do that.

Hi, I just want to know if intellij has some class of refactoring that
allows us to migrate from a class to another, with a similiar
interface (because they both share the Component parent)


--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

THank you, I´ll take that approach the next time, this time I found that Refactor  > Migrate can help me to replace classes across all the project, I just created a new migration map to migrate from awt to swing.

0
Comment actions Permalink

On Thu, 17 Feb 2011 18:42:31 MSK, Jaime Hablutzel
<no_reply@jetbrains.com> wrote, quoted or indirectly quoted someone
who said :

>Hi, I just want to know if intellij has some class of refactoring that allows us to migrate from a class to another, with a similiar interface (because they both share the Component parent)
>
>Thank you.

There is more to flipping from AWT to Swing that putting a J in front
of the component names. One biggy is figuring out where to use
contentPanes.   You might want to tackle it a class at a time.  One
technique is to use a Search/replace script, based on your manual
experience with a few classes, then compile, patch the errors, the
eyeball for gotchas.  See
http://mindprod.com/jgloss/searchreplace.html

A keyword you might want to search for is "migrate". There may be
plugins or tools for helping automate that process.

see http://mindprod.com/jgloss/swing.html for a list of differences
between AWT and Swing you will have to deal with.
--
Roedy Green Canadian Mind Products
http://mindprod.com
Refactor early. If you procrastinate, you will have
even more code to adjust based on the faulty design.
.

0
Comment actions Permalink

One biggy is figuring out where to use contentPanes.


Is this still relevant? Since java5 jframe.add/remove/... calls are forwarded to the contentPane and I can't imagine anyone making a migration awt->swing targetting java1.4.

Or are there some quirks I don't know about that still make it necessary to use contentPanes?

0
Comment actions Permalink

Interesting posts... in my particular case it was no more than an academic project consisting of twenty Panels, with references to old awt API, so I just needed to create a simple migration map for classes, because as I can see they even share the constructor signature.

0

Please sign in to leave a comment.