Anonymous Class to Inner Class
By Geertjan-Oracle on Aug 09, 2007
As one has been able to do in the past, one can let the IDE generate the required abstract methods, by simply clicking the hint that is shown above:
However, now I'm cleaning up my code and I don't want that class to be anonymous anymore. Instead, I want it to be an inner class. In the past, I'd have to call up a dialog box, click various things, and then the inner class would be created. In 6.0, I'll be able to simply select something in the anonymous class and then press Alt-Enter:
Then the small popup shown above appears. I simply press Enter again. And then... I have a new inner class:
And the anonymous class is transformed into a call to my inner class:
And if I don't like the name of my new inner class, I can simply click Ctrl-R over the name, and then I will be able to change the name, as well as references to it, in-line immediately, without any dialog boxes. Hurray!