Preventing split with using styles

Having trouble installing Oxygen? Got a bug to report? Post it all here.
sijomon
Posts: 83
Joined: Wed May 20, 2009 1:18 pm

Preventing split with using styles

Post by sijomon »

Hi,

Yet another query.

I have a document, which is generally to be treated as read-only, within it is a node which is to be treated as read/write.

I was originally intending to enforce this using a DocumentFilter to supress all edit events that occured out side of the target node, however I discovered the Styles property Styles.KEY_EDITABLE which I now set inside a StyleFilter; I set it to true on the target node (and all its children) and false on all other nodes. This works great apart from when using the 'split' function on the target node. 'Splitting' the target node creates another node of the same type as a sibling of the target node, essentially edting the content of the common parent node, which has been marked as readonly in the StyleFilter.

Is the intended behaviour, or is this a bug? Have you any suggestions other than goig back to my DocumentFilter plan?

Many thanks for any assistance you can provide,

Simon.
Radu
Posts: 9048
Joined: Fri Jul 09, 2004 5:18 pm

Re: Preventing split with using styles

Post by Radu »

Hi Simon,

I understand your problem.
Split is proposed in the editable child despite the fact that the parent is marked as not editable and the split will modify it by adding an extra child.
This situation is already fixed in the current development stream which contains better validation checking for split cases and will be available in Oxygen 11.2.
No suggestions for you but to use both a StylesFilter and a DocumentFilter which inhibits the split in this case.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
sijomon
Posts: 83
Joined: Wed May 20, 2009 1:18 pm

Re: Preventing split with using styles

Post by sijomon »

Ok, good to know. I have implemented a minimal DocumentFilter to supress the specific split case I'm interested in.

Thanks for the infor,

Simon.
Post Reply