AuthorDocumentController isEditable method

Are you missing a feature? Request its implementation here.
SSC
Posts: 206
Joined: Thu Dec 01, 2011 4:22 pm
Location: Hamburg, Germany

AuthorDocumentController isEditable method

Post by SSC »

Hello,

Your JavaDoc says the following about the isEditable method in the AuthorDocumentController:

Code: Select all

boolean isEditable(AuthorNode node)

Test if a node is editable or not. A node is not editable for one of the following cases:

the CSS property 'editable' is to 'false';
the node is entirely included into a DELETED change marker.

Parameters:
node - The node to test if is editable.
Returns:
True if the node is editable, false otherwise.
Is it maybe possible to also return false, when the XML file itself is readonly in the filesystem?

Currently I get the readonly state from the IEditorInput, which I pass to the Oxygen Editor, but I´d like to get this information also by using the isEditable method.
If this is a low-hanging fruit to implement this little feature, I would appreciate to have it. Otherwise we also can live with the current solution.

Regards,

Simon
Simon Scholz
vogella GmbH
http://www.vogella.com
Radu
Posts: 9053
Joined: Fri Jul 09, 2004 5:18 pm

Re: AuthorDocumentController isEditable method

Post by Radu »

Hi Simon,

I think that the method is clear in what it does, indeed if the resource is read-only or if the API is used to mark the editor's contents as read-only the node might report that it is editable although you cannot edit in it.
We'll probably maintain the current implementation of the method.

Maybe you could create your own utility method which looks either if the URL of the edited document is read-only or if the edited node is read-only.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
SSC
Posts: 206
Joined: Thu Dec 01, 2011 4:22 pm
Location: Hamburg, Germany

Re: AuthorDocumentController isEditable method

Post by SSC »

Hello Radu,

currently I use such an utility method, that you suggested. While was implementing this utility method, I came up with the idea that your isEditable method of the AuthorDocumentController could also offer this information.
So take this post just as an impluse... :wink:

I wish you a nice weekend :)

Best regards,

Simon
Simon Scholz
vogella GmbH
http://www.vogella.com
Radu
Posts: 9053
Joined: Fri Jul 09, 2004 5:18 pm

Re: AuthorDocumentController isEditable method

Post by Radu »

Hi Simon,

We really appreciate the feedback.
It's really hard to say how API methods should behave in certain circumstances.
Have a nice weekend too.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply