Does anyone know is there a way to open a project in Eclipse in read-only mode? If there is a lot of similar projects open it is easy to make changes to a wrong one.
One sub-optimal solution is to make the project directory read-only in the file system in the underlying OS. I'm not sure how eclipse will react though.
Why would you want to do that ?
There are plenty of solutions to help you focus your efforts on one project : worksets, libraries with source code attached...
Also the mylyn plugin might boost your productivity
You can also use the close project/open project feature : close all projects and only open the one you need to work on ?
This feature is called "binary projects" and is provided by the eclipse plug-in developement environment (PDE). Note that this only works for eclipse plug-in project, see
Contributing to Eclipse - Principles, patterns and plug-ins
or
http://www.vogella.de/articles/EclipseCodeAccess/article.html#importplugins_binary
Putting project in read-only mode is really useful, when you make another instance from the previous project. So you copy all files from old project, then make changes in the new instance. It's really simple to edit files from old project by mistake (they have the same names)!
Serg if you use linux, I suggest to put all files in read only mode with chmod in terminal:
sudo chmod 444 -R /path/to/your/project
After this operation Eclipse will tell you that file you are trying to edit is in read-only mode. I think that's enough to make the previous project safe :)