Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to colour code the editor tabs in eclipse by project?

Tags:

eclipse

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

like image 889
RobLucas Avatar asked Aug 21 '09 10:08

RobLucas


3 Answers

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

like image 179
Rich Seller Avatar answered Oct 25 '22 17:10

Rich Seller


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.

like image 2
VonC Avatar answered Oct 25 '22 17:10

VonC


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.

like image 1
Woody Zenfell III Avatar answered Oct 25 '22 17:10

Woody Zenfell III