inInlineContext not working as expected
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 40
- Joined: Wed Jan 29, 2014 4:30 pm
inInlineContext not working as expected
Hi,
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:
and an instance
My code is
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
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 )*)
Code: Select all
<block><label>The block label</label><para>First para</para><para>Second para</para></block>
Code: Select all
final int caretOffset = authorAccess.getEditorAccess().getCaretOffset();
if (authorAccess.getDocumentController().inInlineContext(caretOffset))
{
// insert my inline element
}
else
{
// insert my block element
}
What am I missing ?
Pascale
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: inInlineContext not working as expected
Post by alex_jitianu »
Hello,
The AuthorDocumentControllerImpl.inInlineContext(int) method works by looking at the CSS styles of the elements around the caret position.
In our tests the method would return false when the caret is positioned between the para elements. It would help if you could post the CSS fragments related to the para, label and block elements (especially the display property).
Best regards,
Alex
The AuthorDocumentControllerImpl.inInlineContext(int) method works by looking at the CSS styles of the elements around the caret position.
In our tests the method would return false when the caret is positioned between the para elements. It would help if you could post the CSS fragments related to the para, label and block elements (especially the display property).
Best regards,
Alex
-
- Posts: 40
- Joined: Wed Jan 29, 2014 4:30 pm
Re: inInlineContext not working as expected
I was expecting the application to detect "inline context" based on the DTD, that is everywhere PCDATA content is allowed.
I have now adapted the display property in the CSS and it works as I want.
Could be worthwhile to add a note in the User Manual that "inline context" is related to the display property of your CSS, with a detailed explanation for each possible value.
For example, I understand the use of display:inline versus display:block but what will happen with the more exoctic values like display:flex, display:inline-block, or display:table-cell ?
Pascale
I have now adapted the display property in the CSS and it works as I want.
Could be worthwhile to add a note in the User Manual that "inline context" is related to the display property of your CSS, with a detailed explanation for each possible value.
For example, I understand the use of display:inline versus display:block but what will happen with the more exoctic values like display:flex, display:inline-block, or display:table-cell ?
Pascale
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: inInlineContext not working as expected
Post by alex_jitianu »
Hello,
I will try to describe more clearly the method's behavior in the documentation. To answer your questions, we don't support flex or inline-block and table-cell is treated just like a block.
Best regards,
Alex
I will try to describe more clearly the method's behavior in the documentation. To answer your questions, we don't support flex or inline-block and table-cell is treated just like a block.
Best regards,
Alex
Return to “SDK-API, Frameworks - Document Types”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service