28

Background:

I'm working on multiple versions of a given project in eclipse. I want to be able to switch between different versions quickly as I fix bugs and prop-back changes to previous releases, so I have the different versions of the code open as different projects (e.g 4.5_Proj, 5.0_Proj). The problem is that when you have the same file open twice it's very easy to loose track of which one you are currently looking at.

Question:

Is it possible to colour code the editor tabs based on which project the file is from?

Alternatively are there any suggestions for other strategies to manage the above problem of needing to edit and test multiple versions of a codebase in eclipse?

Thanks,

Rob

RobLucas
  • 435
  • 4
  • 9
  • Toggle Breadcrumbs http://stackoverflow.com/questions/3069589/how-to-disable-breadcrumbs-in-eclipse you get the project name on each tab – franzag Jun 13 '15 at 01:05
  • 3
    clearly there's interest in this functionality. has anyone taken on the challenge of implementing the plugin, or has it been written since this question was asked? – 6006604 Dec 04 '18 at 13:37

5 Answers5

4

I don't know of any means to colour the editor out of the box. It would certainly be possible to implement a plugin that colours the background or tab based on the project, but I don't know of any existing plugin or option to do so. If working sets or editor linking don't work for you I can give you some pointers on implementing such a plugin yourself.


You can define a working set for each project version (or collection of projects), then set the package explorer to use working sets as the top-level elements. To do this, select the triangle icon on the top right of the Package Explorer view, select Top Level Elements then Working Sets, then create your sets in the Configure Working Sets dialog and select one of the sets.

This means you'd only see the selected working set at any one time. To change between working sets Select the triangle icon and Configure Working Sets..., then select the set you want to see (you can create new ones here too).


Alternatively, if you want to keep track of which project an editor is pointing to, you can link the package explorer selection to the active editor by clicking the Link with Editor icon alt text on the Package Explorer view

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Rich Seller
  • 83,208
  • 23
  • 172
  • 177
2

I believe Mylyn would be a much more effective solution, as it would switch between tasks, to display the current task for the current project.
Then the tabs would reference the correct files from the given project.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
1

Alternatively are there any suggestions for other strategies to manage the above problem of needing to edit and test multiple versions of a codebase in eclipse?

Use Git (or other reasonable VCS tooling) with separate branches for separate versions. git checkout the oldest branch you need to work on first, do your thing, then git checkout the next newer branch and git merge your changes forward (fixing up as needed). Repeat until you're all caught up. (Don't go the other way if possible, since then you have to tease the changes you want apart from those you don't.)

git stash if you need to leave stuff temporarily unfinished in some branch.

If this is not possible, at least use a separate workspace for each version (kind of a hassle due to workspace-based preferences) or open and close projects judiciously. (Perhaps the other suggestions - Working Sets and Mylyn - are better versions of this idea.)

Try not to be so clever that you overwhelm yourself. Breathe. Act deliberately. Let your workspace contain just one self-consistent version of things at a time. (This also helps with interdependent projects, test/search results, etc.)

Or perhaps I misunderstand completely.

Woody Zenfell III
  • 1,905
  • 17
  • 31
0

Try Jeeeyul eclipse theme plugin and change the themes for two eclipse window to identify two different workspace. Update site : http://jeeeyul.github.io/update

Chandrayya G K
  • 8,719
  • 5
  • 40
  • 68
-1

You can mark two files by Ctrl+clicking on it and compare them with right click --> Compare with --> Each other. This opens a very useful perspective for projects like that.

FelixSFD
  • 6,052
  • 10
  • 43
  • 117
Thierry
  • 41
  • 1