Is there a way to configure authorAccess.getDocumentController().inInlineContext(caretOffset) ?
I am asking because it does not work as I expected; it seems to always return true.
I have a custom DTD with the following declaration:
Code: Select all
<!ELEMENT block (label, ( para | list | tablecontainer | graphiccontainer )*)
and an instance
Code: Select all
<block><label>The block label</label><para>First para</para><para>Second para</para></block>
My code is
Code: Select all
final int caretOffset = authorAccess.getEditorAccess().getCaretOffset();
if (authorAccess.getDocumentController().inInlineContext(caretOffset))
{
// insert my inline element
}
else
{
// insert my block element
}
If I place the cursor inside a para element, inInlineContext() returns true; which is correct; but when the cursor is between the 2 para elements, inInlineContext returns also true; which is incorrect.
What am I missing ?
Pascale