66

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.

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.

I hope this makes sense...

northpole
  • 10,244
  • 7
  • 35
  • 58
  • 1
    Honestly, i don't know what you mean with "process". Do you mean task from an issue tracker? Or do you mean your "workflow"? – mhaller Nov 03 '09 at 18:41
  • I mean workflow. Just the files associated with the particular rules I am working on. – northpole Nov 03 '09 at 20:37
  • Eclipse - open all files in current working set? http://stackoverflow.com/a/18366327/2704990 – sa2000 Aug 21 '13 at 20:05
  • see answer for "Eclipse - open all files in current working set?" http://stackoverflow.com/a/18366327/2704990 – sa2000 Aug 21 '13 at 20:08

7 Answers7

31

Mylyn should be your answer here.

Mylyn is a task-focused interface for 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.

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

You can

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

Bookmarks (mentioned here by user1039663) is a valable alternative.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 4
    +1 didn't knew it was possible with mylyn. It's however worth noting that mylyn ships by default with "Eclipse for Java EE" version so that you don't need to download/install it separately. – BalusC Nov 03 '09 at 18:27
  • @BalusC: true, Mylyn is included in every distro but the classic one: see http://www.eclipse.org/downloads/packages/compare-packages – VonC Nov 03 '09 at 18:27
  • 2
    man, I love this site. Thanks for the input, I will play around with this today and see how it works. I will give an update later. – northpole Nov 03 '09 at 18:34
  • I installed and set up Mylyn and first impression...bad a$$! It is not exactly what I was asking for, however, it is much more than I was asking for and in a good way. This is exactly the type of thing I needed right now. Takes a huge project and makes it "smaller" Thanks! – northpole Nov 03 '09 at 23:32
  • The problem with Mylyn is that it makes a bunch of assumptions about your workflow. I've tried Mylyn and it is not at all what I want. – AdamC May 22 '13 at 13:53
  • 6
    It may well be the case that Mylyn is subjectively better than session-like mechanisms, but this does not answers the question asked. This answer only tells what tool may be used, not how to achieve the desired result. – Red Dec 25 '14 at 11:56
  • I guess the question asks how one can set aside group of tabs, possibly giving a name to that set. Then we can close all those tabs and at later time, when I have to work with same set of tabs I can open them all by selecting the set I just created. Is this possible with Mylyn? – Mahesha999 Aug 28 '18 at 08:38
  • @Mahesha999 Not sure, I haven't looked at/used Mylyn since my answer, 9 years ago. – VonC Aug 28 '18 at 08:39
  • any other plugin doing the same? – Mahesha999 Aug 28 '18 at 08:41
  • In Mylyn, following the answer bellow you can Activate the task to reopen all files and Deactivate the task to close all the files. I guess it is fine enough for this question even if not really "user friendly" for a simple thing as : "save path of all opened file" – CodeKiller Apr 25 '19 at 13:04
  • @CodeKiller Thank you. I have included your comment in the answer for more visibility. – VonC Apr 25 '19 at 13:16
21

Eclipse provides multiple ways of structuring the IDE desktop:

  • 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-T and Alt-Left/Alt-Right and Ctrl-Q you can quickly jump to previous locations where you have edited source files. This is a great help in navigating the open workspace.
mhaller
  • 14,122
  • 1
  • 42
  • 61
19

Extended VS Presentation provides capabilities to save sessions.

Unluckily, it only works with Eclipse 3.1 to 3.8:

Project page at Eclipse Marketplace

sessions management

Raúl Moreno
  • 311
  • 3
  • 14
skind
  • 191
  • 1
  • 2
14

The accepted answer tells us which tool could be used but does not provide a quick and dirty explanation on how to 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.

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

  2. Right-click inside the Task List view then New -> Category to create a new category. Right-click again New -> Task to create a new task.

  3. Double-click on the task you just created then click on the Context tab 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 Context tab of the Task List view.

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 List to restore the tab.

Community
  • 1
  • 1
Saïd
  • 8,780
  • 1
  • 28
  • 28
  • 6
    I think one step is missing before step 4. I had to activate the task first, either by right clicking the new task in the Task List and selecting Activate, or toggling the gray dot button in the top left corner of the Task view opened in step 3. – Kevin Jin Sep 14 '17 at 18:50
3

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.

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.

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.

Full set of instructions are here: 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.

Hope you enjoy it;
-Chris

  • wow, this seems great. I was looking for this behaviour in Eclipse for a long time. I tried Eclipse activity but it does not work well with way I use Eclipse. I need some more time to evaluate the usage but for now I'm really excited! :) – chalda Sep 27 '18 at 09:52
  • Wow !! seems great...I was looking for exactly the same. Still if we can have Session in the View section (same like we have view for variables, expressions and breakpoints) then it would be very helpful. – Krutik Dec 24 '19 at 13:52
3

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.

user1039663
  • 1,230
  • 1
  • 9
  • 15
  • I saw the warning on your page too late - about not using this version. So I tried it anyway and it seems to work very nicely on Eclipse Photon Release (4.8.0) Build id: 20180619-1200. Nice work! – AndriesH Jan 19 '19 at 14:26
  • 2
    "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" Really? How? – Gangnus Jul 09 '19 at 14:44
  • @Gangnus Windows > Show View > Bookmarks. Then Edit > Add Bookmark. The answer is lacking. – user1803551 Mar 06 '20 at 17:23
2

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

informatik01
  • 16,038
  • 10
  • 74
  • 104
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555