tags:

views:

1227

answers:

6

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.

+1  A: 

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.

Martin OConnor
+1 This worked for me, I made a project's directory read-only and when I tried to edit a source code file, eclipse promoted me asking if I want to make the file writable...
Lawand
+1  A: 

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

Alexandre Victoor
+1  A: 

You can also use the close project/open project feature : close all projects and only open the one you need to work on ?

Jean
A: 

I have the same problem I want to read a project in read only so while other modify the project I still read the code.

A: 

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

wires
+1  A: 

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 :)

s3m3n