The ro.sync.ecss.extensions.api.UniqueAttributesRecognizer
interface can be implemented if you want to provide for your framework the following features:
You can automatically generate unique IDs for newly inserted elements. Implementations are already available for the DITA and Docbook frameworks. The following methods can be implemented to accomplish this:
/** * Assign unique IDs between a start * and an end offset in the document * @param startOffset Start offset * @param endOffset End offset */ void assignUniqueIDs(int startOffset, int endOffset); /** * @return true if auto */ boolean isAutoIDGenerationActive();
You can split the current block element by pressing the "Enter" key and then choosing "Split". This is a very useful way to create new paragraphs. All attributes are by default copied on the new element but if those attributes are IDs you sometimes want to avoid creating validation errors in the editor. Implementing the following method, you can decide whether an attribute should be copied or not during the split:
/** * Check if the attribute specified by QName can * be considered as a valid attribute to copy * when the element is split. * * @param attrQName The attribute qualified name * @param element The element * @return true if the attribute should be copied * when Split is performed. */ boolean copyAttributeOnSplit(String attrQName, AuthorElement element);
![]() | Tip |
---|---|
The
|