这必须是可能的,但我无法在Eclipse中弄明白.我有
/** ClassA.java */
class A {
...
}
class B {
...
}
Run Code Online (Sandbox Code Playgroud)
我想选择B类并提取到自己的文件,以便我得到:
/** ClassA.java */
class A {
...
}
Run Code Online (Sandbox Code Playgroud)
和
/** ClassB.java */
class B {
...
}
Run Code Online (Sandbox Code Playgroud)
我如何在Eclipse中执行此操作?
aio*_*obe 11
这是你如何做到的(在Eclipse 3.5中工作):
选择要提取的代码:
/** ClassB.java */
class B {
...
}
Run Code Online (Sandbox Code Playgroud)切
右键单击要放置它的包
选择粘贴.(然后根据需要组织导入.)
在我的Eclipse(3.6 - Helios SR1)中,我突出显示类型名称(B),然后右键单击弹出菜单,然后选择Refactor> Move Type to New File ....
编辑:在之前的版本中,它被称为"将成员类型转换为顶级",但已更新为不仅仅适用于成员类型:
http://download.eclipse.org/eclipse/downloads/drops/R-3.6-201006080911/eclipse-news-part2.html
将类型移动到新文件重构.
"将成员类型转换为顶级重构"已重命名为"将类型移动到新文件",现在允许将文件中的任何辅助类型移动到其自己的文件中.该操作继续适用于成员类型.
| 归档时间: |
|
| 查看次数: |
4929 次 |
| 最近记录: |