Eclipse - 拆分视图中的相同 .Java 文件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2198822/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Eclipse - Same .Java file in split view?
提问by Federer
Perhaps this is a trivial question, however it's something that is seriously annoying me. I'm editing someone's program at the minute and one of their .java
files is absolutely massive. I'm trying to edit it at the moment, whilst referencing it as well.
也许这是一个微不足道的问题,但它让我非常恼火。我正在编辑某人的程序,他们的一个.java
文件绝对是巨大的。我现在正在尝试编辑它,同时也引用它。
Is it possible to split the screen in Eclipse, to allow a split view of the same file?
是否可以在 Eclipse 中拆分屏幕,以允许同一文件的拆分视图?
回答by Alberto Zaccagni
A. Window -> New editor
A. 窗口 -> 新编辑器
or (slightly quicker)
或(稍微快一点)
B. Right-click on the tab with the code you want to see in another split view and choose "New Editor" to duplicate this tab in the sameeditor window (i.e. without having to open a completely new editor window as in A.)
B. 右键单击您想要在另一个拆分视图中查看代码的选项卡,然后选择“新建编辑器”以在同一编辑器窗口中复制此选项卡(即不必像 A 中那样打开一个全新的编辑器窗口。)
Then drag the new tab to the right until you see an arrow, then lift your finger. Doing it this way the two views will be in sync: everything you change on the left will change on the right.
然后向右拖动新选项卡,直到看到一个箭头,然后抬起手指。这样做,两个视图将同步:您在左侧更改的所有内容都会在右侧更改。
回答by VonC
Lars Vogel just announced (December 2013) in "Split editor implemented in Eclipse M4 Luna" that is is now possible possible!
Lars Vogel 刚刚在“在 Eclipse M4 Luna 中实现的拆分编辑器”中宣布(2013 年 12 月),这现在是可能的!
Split editor implemented in Eclipse M4 Luna 4.4
在 Eclipse M4 Luna 4.4 中实现的拆分编辑器
This solves one of the oldest and most upvoted Eclipse bug: Bug 8009.
这解决了最古老和最受好评的 Eclipse 错误之一:错误 8009。
The split editor functionality has been developed in Bug 378298, and will be available as of Eclipse Luna M4. The Note & Newsworthy of Eclipse Luna M4 will contain the announcement.
Current shortcut for splitting is:
- Ctrl+ _for split horizontally, and
- Ctrl+ {for split vertically.
拆分编辑器功能已在错误 378298 中开发,并将从 Eclipse Luna M4 开始提供。Eclipse Luna M4 的注释和新闻价值将包含该公告。
当前拆分的快捷方式是:
- Ctrl+_用于水平分割,以及
- Ctrl+{用于垂直拆分。
As commentedby mahesha999, there is a clone option in menu Window > Editor > Clone
which opens separate cloned window/tab (instead of split view inside the same tab) that can be dragged to the 2nd monitor.
正如mahesha999所评论的,菜单中有一个克隆选项,可以打开单独的克隆窗口/选项卡(而不是同一选项卡内的拆分视图),可以将其拖动到第二个监视器。Window > Editor > Clone
回答by Eduardo Moreno
For two tabs:
对于两个选项卡:
Window > Editor > Clone
Window > Editor > Clone
For same tab (as shown above):
对于相同的选项卡(如上所示):
Window > Editor > Toggle Split Editor
Window > Editor > Toggle Split Editor
回答by Maksim Areshkau
I have implemented small plugin which can split view for any eclipse based editor and make a video have it's work, see video here http://www.youtube.com/watch?v=61yJF7LQ-bE. This plugins part of jboss tools, but can be installed. With it you can split editor view just by clickin CTRL+8 or window->New Editor(Side By Side).
我已经实现了小插件,它可以为任何基于 Eclipse 的编辑器拆分视图并使视频正常工作,请在此处查看视频http://www.youtube.com/watch?v=61yJF7LQ-bE。这个插件是 jboss 工具的一部分,但可以安装。有了它,您只需单击 CTRL+8 或窗口->新编辑器(并排)即可拆分编辑器视图。