
|
If you were logged in you would be able to see more operations.
|
|
|
|
Original Estimate:
|
Unknown
|
Remaining Estimate:
|
Unknown
|
Time Spent:
|
Unknown
|
|
| Build: |
6,656
|
| Severity: |
High
|
With code like this
you should be able to point at layeredPane and ask IDEA to introduce a new class to encapsulate code relating to it.
IDEA should do its best to drag along as much code as possible into the new class,
soliciting confirmation on code you might not want to move.
The above extract is from the Java Tutorial LayeredPaneDemo.
This tarball contains the original, my refactoring,
and IDEA project and module files.
http://Yost.com/computers/java/LayeredPaneDemo/LayeredPaneDemoRefactored.tgz
|
|
Description
|
With code like this
you should be able to point at layeredPane and ask IDEA to introduce a new class to encapsulate code relating to it.
IDEA should do its best to drag along as much code as possible into the new class,
soliciting confirmation on code you might not want to move.
The above extract is from the Java Tutorial LayeredPaneDemo.
This tarball contains the original, my refactoring,
and IDEA project and module files.
http://Yost.com/computers/java/LayeredPaneDemo/LayeredPaneDemoRefactored.tgz |
Show » |
|
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.