
You could implement a HashMap in your WorkspaceAccessPluginExtension which would keep that flag for a certain URL for which you wanted the open operation to work. Interesting idea... Actually, that's just to keep track of the buffers opened by the plugin. So probably the best is to use a set
Oxygen XML Editor Support wrote: Hi, Thank you for your detailed answer! based on object identities, with the WSEditor objects. Do we have the guarantee that the WSEditor object does not change between the moment a file is open and when it is closed? Object identity looks like more robust to me than URI comparison, isn't it? BTW, shouldn't a WSEditor object be returned by Workspace.open()?
Is that boolean flag somewhat related to whether the URL was opened for editing or read-only by the user? No, but that's also a requirement ;-) Is there any way to open a file in read-only using the API? Other than creating a dedicated WSEditorChangeListener of course.
2/ to specify a method to be called before closing the buffer (kind of a buffer listener, so I can do some treatment before closing it)? So you want some kind of a listener to notify you before an opened editor is closed, right? Precisely. WSEditorChangeListener.editorAboutToBeClosed(URL) WSEditorChangeListener.editorClosed(URL) Perfect! Thank you, regards, -- Florent Georges http://fgeorges.org/ http://h2oconsulting.be/