有没有办法将工作区路径添加到 Eclipse IDE 标题栏?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3170379/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 14:51:49  来源:igfitidea点击:

Is there a way to add the workspace path to the Eclipse IDE title bar?

eclipseworkspacetitlebar

提问by mP.

I sometimes run more than one eclipse with a new version of a project and another with an older version in a different workspace. Add an extra window view of the "new" version and it becomes difficult to tell when alt=tabbing which eclipse belongs to which workspace.

有时,我会在不同的工作区中运行多个带有新版本项目的 Eclipse 和带有旧版本的另一个 Eclipse。添加“新”版本的额外窗口视图,并且当 alt=tabbing 哪个 eclipse 属于哪个工作区时变得难以分辨。

When a lot of files are involved with minor changes the only way to tell is to get the properties of a particular file and check the path. This of course is slow, there must be better way and having the workspace path in the title bar would make it easy to spot which instance is working with which workspace.

当大量文件涉及微小更改时,唯一的判断方法是获取特定文件的属性并检查路径。这当然很慢,必须有更好的方法,并且在标题栏中包含工作区路径可以很容易地发现哪个实例正在使用哪个工作区。

Is there a way to include the workspace path in the title bar so one can easily tell which workspace one is working with?

有没有一种方法可以在标题栏中包含工作区路径,以便人们可以轻松分辨出正在使用哪个工作区?

回答by VonC

If you add -showlocationin its own line at the beginning of your eclipse.ini, you will have the current workspace automatically displayed in the title bar.
(see this example of eclipse.ini)

如果您-showlocation在 的开头添加自己的行eclipse.ini,您将在标题栏中自动显示当前工作区。
(见这个例子eclipse.ini

alt text

替代文字

回答by Ondra C.

If you go to Window -> Preferences -> General -> Workspace, there is an item "Workspace name (shown in window title):" that you can use. (I use Eclipse Helios CDT)

如果您转到“窗口”->“首选项”->“常规”->“工作区”,则可以使用“工作区名称(显示在窗口标题中):”项。(我使用 Eclipse Helios CDT)

回答by ROMANIA_engineer

Eclipse Oxygen (4.7)

日食氧气 (4.7)

In Eclipse Oxygenyou can add the workspace path to the configurable Window title.

Eclipse Oxygen 中,您可以将工作区路径添加到可配置的窗口标题中

  1. Window> Preferences

  2. General> Workspace> check Show full workspace path

    General >Workspace >Show full workspace path

  3. Result:

    Eclipse title bar

  1. 窗口>首选项

  2. 常规>工作区> 选中显示完整的工作区路径

    常规 >工作区 >显示完整的工作区路径

  3. 结果:

    Eclipse 标题栏

Eclipse Neon (4.6) & Eclipse Mars (4.5)

日食霓虹灯 (4.6) 和日食火星 (4.5)

The checkbox is in the same location, but it has a different text - Show workspace path in window title:

该复选框位于同一位置,但具有不同的文本 -在窗口标题中显示工作区路径

Show workspace path

Show workspace path

回答by Dave L.

-showlocation is great, but it only changes the text at the end of the title bar, so it's often not visible in the taskbar.

-showlocation 很棒,但它只更改标题栏末尾的文本,因此它通常在任务栏中不可见。

If you want to change the beginning of the title bar, which shows the current Perspective, you can use Window -> Save Perspective As... and the new title will be visible in the Taskbar.

如果要更改显示当前透视图的标题栏的开头,可以使用窗口 -> 透视图另存为...,新标题将在任务栏中可见。

回答by Omi

In Eclipse-Mars I am seeing "Workspace Name" as an option that lets you type your custom workspace name, not sure in which version this was introduced but this option is available on the same location where @Oncra C pointed (Window->Preferences->General->Workspace). The value you enter gets prepended to the start of the title.

在 Eclipse-Mars 中,我看到“工作区名称”作为一个选项,可让您键入自定义工作区名称,不确定这是在哪个版本中引入的,但此选项在@Oncra C 指向的同一位置可用(Window->Preferences->General->Workspace)。您输入的值被添加到标题的开头。