Eclipse - different folder-/file colors per project - eclipse

I'm looking for a way to optically mark different projects in the eclipse "Project Explorer".
From time to time I have to work with several opened projects, to copy files and folders from old to new projects. (I know it is possible to compare folders.. but it is not always the best way)
So it would be really convenient to apply a different color for the main project. E.g. having displayed the folders of that project in green instead of yellow - so this would avoid copy-pasting in the wrong 'direction'.
Any ideas? Or other tips?
Edit:
Added image

Eclipse isnt exploded make-up-bag :D
If you have your projects unter Version-Controll, you can specify custom file/folder/project-decorators with markant Text-Labels.
Therefore see Window->Preferences->Team->...->Label Decoration

Related

Different color for each project in a workspace

I have two projects in a workspace.
In each project I have some files that are named the same.
I sometimes edit one instead of the other.
Is it possible to distinguish the files depending on the project they are in - like having a color for each project?
I use toolbar colors. For example, a solution with client and server sub-projects has different setting files to get green toolbar for one project and blue one for another. This really helps me. Setting files: file1, file2.

How to change the eclipse window colour based on the workspace?

If I'm working on live branch as well as development branch at almost same time,
naturally the code in both the branches is similar,
my two eclipse instances are open at the same time,
I keep swapping between them and tend to commit mistake by adding code in the wrong workspace.
To distinguish between the two instances of eclipse if I could have different themes (colours), it could have been good fool proofing measure.
I would like different theme for the eclipse window than the code font or file background.
I use same eclipse (Helios) .exe for different workspaces.
Any simpler advice could also be helpful.
Thanks in advance.
You can also add a name for each workspace. Open Preferences>General>Workspace and enter a Workspace name. It will be shown at the beginning of the title in the shell and the task bar.
That's how I differentiate my 4.2 and 3.8 workspaces, since I often need them both open to compare behaviour.
You may right mouse click in the background of one of your files > Preferences > Text Editor and change background color.

How do I make eclipse (Indigo) collapse empty (parent) packages?

What I want to do is simply use the eclipse package explorer in hierarchical view but with empty packages being collapsed so I don't have to open 5+ packages to find the first Java file.
I'm not even sure how I did it in previous versions, but I've never had any trouble finding it before, it just seems to be gone now. I have a feeling there was a "flatten hierarchy" tick-box somewhere.
To clarify I get this:
com
example
etc
file1.java
Rather than:
com.example.etc
file1.java
I'm using Eclipse Indigo (v. 3.7.1)
Open the View menu (small triangle in top right corner), open filters and check Empty parent packages.
In most cases it works, but in case of existing projects it does not always work as expected. If you seem to have troubles, try to export the project, remove it, then re-add the exported version (or re-checkout from your VCS).
Assuming the view filter is engaged properly, perhaps your source folders are not as "empty" as you think.
For example, on Apple OS X, Eclipse will detect .DS_STORE entires along your src/package/hierarchy, making the parent packages technically non-empty.
Delete any such hidden files and refresh your project.
Window - Preferences - Java - Appearance - Abbreviate package names
And enter the following rule:
com.example.etc={cee}
I don't know what the problem actually was, but I couldn't get it fixed until I gave up altogether and reinstalled the OS (it was a fresh install anyway), and eclipse. It was completely fine after that. :\
Click on the arrow at the top right of the "Package explorer" and choose "Package presentation -> flat"
Try to restart Eclipse once in a while. I had trouble getting it to work, and after an Eclipse restart it suddenly was working again.

In intelliJ/Eclipse is there away to never open files from bin or target or build? or warn?

I just lost another 20 minutes because my IDE (sometimes I use IntelliJ, sometimes I use Eclipse) opened a file that was from the "bin, target, or build" folder... and I mistakenly thought it was from the src folder.
As I developer I almost always want the source code to look at, not build output artifacts... is there away to make the IDE either not present these as choices, or have it warn me visually that the file is not source (like surrounding the editor in a thick band of zebra stripped yellow and black lines? )
In IDEA output folders are excluded by default and are not visible in the Project View. Navigation to files from excluded folders also will not work. Double check that these folders are marked as Excluded in the Project Structure | Sources tab.
In Eclipse I use package explorer to navigate between source files, jsp, etc. It does not show any build/target/bin folders and there possibility to configure filters for it (Small down faced arrow next to titlebar)

Eclipse PDT Differentiating file name tabs for MVC?

When working with MVC in Eclipse you might often have a model, view, and controller all with the same name open at the same time. When looking at each of the file tabs, you won't always know which is which and have to click through them, which can be quite a hassle sometimes. I've heard of being able to color code files based on the path in some editors. For example, tabs with path model could be set as green, path controller set as yellow, etc. Is this possible in Eclipse, or is there a plugin for something like this? If not, what do you do to more easily differentiate between the tabs? I've heard of people always opening a MVC set in a certain order. So you'll know the leftmost tab is the controller, the right most is the view, etc. However, that must also mean you need to open all 3 files each time. Any better tips or tricks?
Another thing about the file tabs that can be annoying is that when you have more files that can't fit in one line, eclipse pushes off to an arrow which you have to click to see the rest. It seems to be random which tabs get pushed off there, maybe the least used ones, I have no idea... This coupled with the problem above gets kind of annoying. I was trying to find a way to disable this and just show tabs that can't fit in one line to show up on a second line, but surprisingly couldn't find such an option (then again you also can't wordwrap without a plugin).
Hopefully there are some solutions to these two problems. Thanks.
Maybe this can be helpful
http://www.dipherence.com/2011/03/20/full-coloured-eclipse-navigator-plug-in/
With the latest version of Eclipse (Kepler 4.3.1, build M20130911-1000) when two or more files with the same base name are opened, tab will show also the parent directory name.