| Priority |
Normal |
| Type | Feature |
| State | Open |
| Assignee | Dmitry Jemerov |
| Subsystem | Refactoring |
| Affected versions |
No affected versions
|
| Fix for |
No fix versions
|
| Build |
6656
|
| Severity |
0
|
IDEA-36434 |
New refactoring: Introduce class... |
|
|
private JLabel createColoredLabel(String text, Color color, Point origin) { JLabel label = new JLabel(text); label.setVerticalAlignment(JLabel.TOP); label.setHorizontalAlignment(JLabel.CENTER); label.setOpaque(true); label.setBackground(color); label.setForeground(Color.black); label.setBorder(BorderFactory.createLineBorder(Color.black)); label.setBounds(origin.x, origin.y, 140, 140); return label; }
If I could point IDEA at this label variable an introduce a new ColoredLabel class, then the next thing I would do would be to inline this method. It would be extra cool if IDEA would incorporate both steps in one.
Just to have this ability to introduce a class would be great, but knowing you guys, you'll also take on all the really hard work of managing interconnections between the new class and the code that uses it, introducing fields, constructor arguments, accessors, etc., to make it really awesome.
Also, maximally reducing the specificity of the type of the variable that refers to an instance of the introduced class would also be nice.
If you can make IDEA able to do most of the work I did in this LayeredPaneDemo file, you will have made an important addition to IDEA's refactoring abilities.
Please remember to give us flexibility to make the introduced class either an inner class, a class in the same file, or a standalone class.
http://yost.com/computers/java/java-spaghetti/