SaurabhJinturkar
SaurabhJinturkar

Reputation: 554

How to change open with options in navigator depending upon name of the resource?

I am working on eclipse RCP application which implements CommonNavigator view to display navigator. I have few LinkedResources in navigator that link to files on the file system with custom extension. These custom extension files are opened in custom editor as well as in TextEditor.

One of the file named default.ext will be common to all the projects and I want to keep it read only. Is it possible to open file in custom editor only? For ex. Default.ext should be opened in only custom editor, however Test.ext should be opened in custom editor as well as text editor.

This way I could handle save action in my editor depending upon file name and keep the file read only.

Is there any other way to keep files read only?

Upvotes: 0

Views: 63

Answers (1)

Martti Käärik
Martti Käärik

Reputation: 3621

Short answer: not possible in the way you describe.

Long answer: if somebody really wants to modify a file then there's no way or need to stop this. What you can do is either (1) hide the file from user or (2) set Read-only flag to discourage users from modifying the file.

Upvotes: 1

Related Questions