您可以在 Eclipse 中保存选项卡组以便以后打开它们吗?

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

Can you save groups of tabs in Eclipse so you can open them later?

javaeclipse

提问by northpole

I have several different processes within a single project that I work on. I am constantly opening and closing tabs(java files) in the code editor for that particular process. Each process almost always uses the same java files.

在我从事的一个项目中,我有几个不同的流程。我不断在代码编辑器中为该特定进程打开和关闭选项卡(java 文件)。每个进程几乎总是使用相同的 java 文件。

I was wondering if it is possible to save what files are opened as part of the working set so I can select what working set I want and have all the java files open that I will need to work with. Currently the working set just sets the tree to these files, but I am looking to also have it open the files I need.

我想知道是否可以将打开的文件保存为工作集的一部分,以便我可以选择我想要的工作集并打开我需要使用的所有 java 文件。目前,工作集只是将树设置为这些文件,但我希望它也能打开我需要的文件。

I hope this makes sense...

我希望这是有道理的...

采纳答案by VonC

Mylynshould be your answer here.

Mylyn应该是你的答案。

Mylyn is a task-focused interfacefor Eclipse that makes working with very large workspaces as easy as working with small ones.
Mylyn extends Eclipse with mechanisms for keeping track of the tasks that you work on.

Mylyn monitors your work activity on those tasks to identify information relevant to the task-at-hand. Mylyn monitors Eclipse and captures your interaction in a task context.
System artifacts such as files, types, methods, and fields get assigned a degree-of-interest based on how recently and frequently you interact with them.
This results in uninteresting elements being filtered from view within Eclipse, allowing you to focus in on what is important.

Mylyn 是Eclipse 的以任务为中心的界面,它使处理非常大的工作区就像处理小工作区一样容易。
Mylyn 使用用于跟踪您所处理的任务的机制扩展了 Eclipse。

Mylyn 监控您在这些任务上的工作活动,以识别与手头任务相关的信息。Mylyn 监视 Eclipse 并在任务上下文中捕获您的交互。
系统工件(例如文件、类型、方法和字段)根据您与它们交互的最近和频繁程度被分配一个感兴趣的程度。
这会导致从 Eclipse 中的视图中过滤掉无趣的元素,从而使您能够专注于重要的内容。

Following Saheed's answer, don't miss CodeKiller's comment:

按照Saheed回答,不要错过CodeKiller评论

You can

  • Activate the task to reopen all files and
  • Deactivate the task to close all the files.

你可以

  • 激活任务以重新打开所有文件并
  • 停用任务以关闭所有文件。


Bookmarks(mentioned hereby user1039663) is a valable alternative.

书签(由user1039663在这里提到)是一个有价值的替代品。

回答by mhaller

Eclipse provides multiple ways of structuring the IDE desktop:

Eclipse 提供了多种构建 IDE 桌面的方法:

  • Perspectives:Customization of the positions of open and closed views and editors. You can copy and rename existing perspectives like the Java perspective and suit them to your needs by customizing them. See the Window menu or right-click on the perspective icon in the upper right corner
  • Task Management Tools like Mylyn:see answer by VonC
  • Multiple Windows:You can open new windows and move them to your second monitor. Select Window > New Window to open a new window. Each window keeps track of its own open editors.
  • Multiple Instances of Eclipse:You can always use multiple workspaces and multiple instances of Eclipse. However, this is only recommended when working on different projects, as both instances would overwrite each others files when rebuilding.
  • Hotkeys:By using shortcuts like Ctrl-Tand Alt-Left/Alt-Rightand Ctrl-Qyou can quickly jump to previous locations where you have edited source files. This is a great help in navigating the open workspace.
  • 视角:自定义打开和关闭视图和编辑器的位置。您可以复制和重命名现有的透视图,如 Java 透视图,并通过定制它们来满足您的需要。查看窗口菜单或右键单击右上角的透视图标
  • Mylyn 等任务管理工具:请参阅 VonC 的回答
  • 多个窗口:您可以打开新窗口并将它们移动到您的第二台显示器。选择窗口 > 新窗口打开一个新窗口。每个窗口都会跟踪自己打开的编辑器。
  • 多个 Eclipse 实例:您始终可以使用多个工作区和多个 Eclipse 实例。但是,仅在处理不同项目时才建议这样做,因为两个实例在重建时都会覆盖彼此的文件。
  • 热键:通过使用Ctrl-TAlt-Left/Alt-Right等快捷方式,Ctrl-Q您可以快速跳转到之前编辑过源文件的位置。这对导航打开的工作区很有帮助。

回答by skind

Extended VS Presentationprovides capabilities to save sessions.

Extended VS Presentation提供了保存会话的功能。

Unluckily, it only works with Eclipse 3.1 to 3.8:

不幸的是,它只适用于 Eclipse 3.1 到 3.8:

Project page at Eclipse Marketplace

Eclipse Marketplace 上的项目页面

sessions management

会话管理

回答by Saheed

The accepted answertells us whichtool could be used but does not provide a quick and dirty explanation on howto use it.

接受的答案告诉我们可以使用哪种工具,但没有提供关于如何使用它的快速而肮脏的解释。

In my case, I hadn't finished researching a large code base but I needed to save my progress so I could return to it later hence the need to save all open tabs using Mylyn.

就我而言,我还没有完成对大型代码库的研究,但我需要保存我的进度以便稍后返回,因此需要使用 Mylyn 保存所有打开的选项卡。

  1. If you already have Mylyn installed, navigate to Window -> Show View -> Task Listto view the list of tasks. If you've never used it before, the list will be empty.

  2. Right-click inside the Task Listview then New -> Categoryto create a new category. Right-click again New -> Taskto create a new task.

  3. Double-click on the task you just created then click on the Contexttab at the bottom left of the view.

  4. Now navigate to each tab which you would like Mylyn to save by clicking on the tab name. Notice how an entry for the source file for that tab is added in Contexttab of the Task Listview.

  1. 如果您已经安装了 Mylyn,请导航到Window -> Show View -> Task List以查看任务列表。如果您以前从未使用过它,则该列表将为空。

  2. Task List视图内右键单击,然后New -> Category创建一个新类别。再次右键单击New -> Task以创建新任务。

  3. 双击您刚刚创建的任务,然后单击Context视图左下角的选项卡。

  4. 现在通过单击选项卡名称导航到您希望 Mylyn 保存的每个选项卡。请注意如何ContextTask List视图的选项卡中添加该选项卡的源文件条目。

Once you've cycled through all the tabs you'd like to save, you can confirm they were saved by closing each one and double-clicking the source file in the Task Listto restore the tab.

循环浏览要保存的所有选项卡后,您可以通过关闭每个Task List选项卡并双击 中的源文件来恢复选项卡来确认它们已保存。

回答by Christopher Hull

I've edited this answer as per below comment (include essential parts of answer in this post).

我已经按照下面的评论编辑了这个答案(包括这篇文章中答案的基本部分)。

Yes, you can save off groups of tabs in Eclipse by installing this Session Manager plug-in.

是的,您可以通过安装此会话管理器插件来节省 Eclipse 中的选项卡组。

I've wanted this functionality in Eclipse as well. I recently wrote a feature and have been successfully using it for a few months now. It is a new OSGi type extension and works with Eclipse Neon and above.

我也想在 Eclipse 中使用此功能。我最近编写了一个功能,并且已经成功使用它几个月了。它是一个新的 OSGi 类型扩展,适用于 Eclipse Neon 及更高版本。

Here's how to install it.

这是安装方法。

  • In Eclipse, go to Help → Install New Software
  • Click “Add”, enter a name like “Editor Sessions” and the following URL. http://spillikinaerospace.com/eclipseInstall/
  • Unckeck “Group items by category” to see the feature.
  • Check the box that says “Editor Sessions Manager” and click Next.
  • Read and agree to the short license agreement.
  • Click the remaining install buttons.
  • Allow Eclipse to restart.
  • 在 Eclipse 中,转到帮助 → 安装新软件
  • 单击“添加”,输入“编辑器会话”等名称和以下 URL。 http://spillikinaerospace.com/eclipseInstall/
  • 取消选中“按类别分组项目”以查看该功能。
  • 选中“Editor Sessions Manager”框,然后单击“下一步”。
  • 阅读并同意简短的许可协议。
  • 单击其余的安装按钮。
  • 允许 Eclipse 重新启动。

Full set of instructions are here: http://chrishull.com/projects/eclipse/

全套说明在这里:http: //chrishull.com/projects/eclipse/

Please give it a try and send comments. I've found it a very useful tool as I work with several Eclipse projects at once and need to recall file groups.

请试一试并发送评论。我发现它是一个非常有用的工具,因为我同时处理多个 Eclipse 项目并且需要调用文件组。

Hope you enjoy it;
-Chris

希望你喜欢它;
-克里斯

回答by user1039663

In addition to all mentioned... Did you try Bookmarks? You can save multiple bookmarks into one set, there are bookmark sets management option and you can add descriptions with prefixes to group bookmarks on the same set. Finally and more important: you can select multiple bookmarks, select goto and multiple editors will be opened at once.

除了所有提到的...您是否尝试过书签?您可以将多个书签保存到一个集合中,有书签集合管理选项,您可以添加带有前缀的描述以将同一集合中的书签分组。最后也是更重要的是:您可以选择多个书签,选择 goto 将同时打开多个编辑器。

回答by BalusC

You need a Macro. Searching using this term at Eclipse plugin sites like eclipseplugincentral.comand so on must yield enough suggestions, for example Practically Macro. Good luck.

你需要一个。在 Eclipse 插件站点(如eclipseplugincentral.com等)上使用该术语进行搜索必须产生足够的建议,例如Practical Macro。祝你好运。