eclipse 在可见选项卡下保留以前打开的文件选项卡
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11255389/
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
Retain previous open file tab under visible tabs
提问by SyAu
Eclipse Juno - In my workspace I have 'Package Explorer' opened on the left side, on the right side I have 6 visible file tabs and under 'Show List' I have 17 files.
Eclipse Juno - 在我的工作区中,我在左侧打开了“Package Explorer”,在右侧我有 6 个可见的文件选项卡,在“Show List”下我有 17 个文件。
Out of those 6 visible file tabs, I'm working on the 3rd file (abc.java) and If I pick up a file under 'Show List' (xyz.java), then eclipse displays xyz.java as active tab and the next 5 files from the Show List. My previous visible file tabs are gone and now I have a new set of visible file tabs. Is there a way to have my previous active file 'abc.java' under visible file tabs with my current active file as 'xyz.java'
在这 6 个可见文件选项卡中,我正在处理第 3 个文件 (abc.java),如果我在“显示列表”(xyz.java) 下选择一个文件,则 eclipse 将 xyz.java 显示为活动选项卡,并且显示列表中的下 5 个文件。我以前的可见文件选项卡不见了,现在我有了一组新的可见文件选项卡。有没有办法将我以前的活动文件“abc.java”放在可见文件选项卡下,并将我当前的活动文件作为“xyz.java”
采纳答案by oyse
I think I just had the same problem and I solved it by switching the theme.
我想我只是遇到了同样的问题,我通过切换主题解决了它。
Go to Preferences -> General -> Appearance and switch to the Classic theme.
转到首选项 -> 常规 -> 外观并切换到经典主题。
I can't understand why this helps, but it worked for me.
我不明白为什么这有帮助,但它对我有用。
Update:
更新:
After being bitten by this again I checked again and as @anweibel says in his answer this can be edited in the CSS.
再次被这个咬后,我再次检查,正如@anweibel 在他的回答中所说,这可以在 CSS 中进行编辑。
I just installed the E4 CSS editor plugin using the Eclipse Marketplace so that I could change the CSS directly from Eclipse under Preferences -> Apperance. I changed swt-mru-visible from false to true so that the relevant part for the GTK theme looked like this:
我刚刚使用 Eclipse Marketplace 安装了 E4 CSS 编辑器插件,以便我可以直接从 Eclipse 的 Preferences -> Apperance 下更改 CSS。我将 swt-mru-visible 从 false 更改为 true,以便 GTK 主题的相关部分如下所示:
.MPartStack {
font-size: 11;
swt-simple: false;
swt-mru-visible: true;
}
A restart was required for the changes to take effect.
需要重新启动才能使更改生效。
More info can also be found here: Eclipse tabs repositionning
更多信息也可以在这里找到:Eclipse tabs repositionning
回答by anweibel
There's a more straight-forward way to bring back the old tab behavior of the eclipse Juno editor:
有一种更直接的方法可以恢复 Eclipse Juno 编辑器的旧标签行为:
- Go to
INSTALL/plugins/org.eclipse.platform_4.2.0.qualifier/css
- Choose the CSS for the theme that you use
- Replace
swt-mru-visible: false;
withswt-mru-visible: true;
- Restart eclipse (I haven't tested if that's necessary, at all)
- 去
INSTALL/plugins/org.eclipse.platform_4.2.0.qualifier/css
- 为您使用的主题选择 CSS
- 替换
swt-mru-visible: false;
为swt-mru-visible: true;
- 重新启动 eclipse(我还没有测试过是否有必要)
If that doesn't work, also look in INSTALL/configuration/org.eclipse.e4.ui.css.swt.theme/
for CSS files.
如果这不起作用,还要查找INSTALL/configuration/org.eclipse.e4.ui.css.swt.theme/
CSS 文件。
If you have a look at the css files of the different themes, you can see why switching the theme solves the problem as well.
如果您查看不同主题的 css 文件,您就会明白为什么切换主题也能解决问题。
回答by Minibiti
Here is a quick update for anweibel's answer for Eclipse Luna:
这是 anweibel 对 Eclipse Luna 的回答的快速更新:
The CSS you wanna edit is now located at
您要编辑的 CSS 现在位于
- INSTALL/plugins/org.eclipse.ui.themes_1.0.0.qualifier/css
- 安装/插件/org.eclipse.ui.themes_1.0.0.qualifier/css
回答by grayswander
Quick Linux fix for all themes:
所有主题的快速 Linux 修复:
cd <eclipse install dir>
find . -type f -name "*.css" | xargs grep 'swt-mru-visible: false' | cut -d: -f1 | xargs -n1 sed -i.orig 's/swt-mru-visible: false/swt-mru-visible: true/'
This will find all CSS files with "swt-mru-visible: false", back them up with *.orig suffix and change to "swt-mru-visible: true"
这将找到所有带有“swt-mru-visible: false”的 CSS 文件,用 *.orig 后缀备份它们并更改为“swt-mru-visible: true”
You can find all backup files with"
您可以找到所有备份文件“
find . -type f -name "*.orig"