Community
Participate
Working Groups
Build Identifier: 3.6.2 When an external files is opened within Eclipse (either through DND or through the File->Open menu) and this file is read only it cannot be changed ( inside the text, xml editor) and there is also no possibility within eclipse to change the read-only state of the file. What I would expect is that it behaves the same way as with internal files that are opened. Reproducible: Always
I guess this goes to Platform Text. Please move back if not.
The following classes are used when an external file is opened in Eclipse: 1. OpenLocalFileAction.run() (when a file is opened using the File->Open menu) 2. EditorAreaDropAdapter.asyncDrop() (when a file is dnded on the editor area) Both are calling IDE.openEditorOnFileStore() Maybe before opening the file a dialog could be shown where the user can decide to make the files writable before opening them.
> Maybe before opening the file a dialog could be shown where the user can decide > to make the files writable before opening them. Better workflow is to only ask when the user actually tries to modify the document (like with read-only internal files).
(In reply to comment #3) > > Maybe before opening the file a dialog could be shown where the user can decide > > to make the files writable before opening them. > > Better workflow is to only ask when the user actually tries to modify the > document (like with read-only internal files). You are right. But this has to be implemented by each editor (base class). The first solution is independent of any editor type. And normally does a user know whether he wants to edit a file before opening it.
After digging inside the code your proposed solution will become quite complex to realise since the read-only check is done by the DefaultUIFileModificationValidator class. And this class (its super class FileModificationValidator) is used in a lot of places and uses only IFile.
We will not invent a new workflow.
(In reply to comment #6) > We will not invent a new workflow. Ok. I can understand that. For my proposed solution I could provide a patch. Unfortunately my understanding of the eclipse platform is not good enough to provide a patch for the final solution. :)
Deepak, in addition to what Markus suggested in comment 3 we could go with bug 66970.