Content Completion > Surround With not schema aware
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 168
- Joined: Fri Jan 20, 2017 1:11 pm
Content Completion > Surround With not schema aware
Hello,
We use the version 24.0.0.2 of the SDK.
In Author view, when an element is selected, the content completion (obtained by pressing Enter key) provide the Surround with pop up.
The problem is that this pop up is not schema aware.
Each time you select an element from this pop-up, it surround well but the xml is not valid anymore.
Can we configure this Surround with pop up ?
If yes, how ? I did not find any documentation.
Regards,
Isabelle
We use the version 24.0.0.2 of the SDK.
In Author view, when an element is selected, the content completion (obtained by pressing Enter key) provide the Surround with pop up.
The problem is that this pop up is not schema aware.
Each time you select an element from this pop-up, it surround well but the xml is not valid anymore.
Can we configure this Surround with pop up ?
If yes, how ? I did not find any documentation.
Regards,
Isabelle
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Content Completion > Surround With not schema aware
Hello Isabelle,
We have an internal issue to enhance the "surround with" functionality, I added your feedback to it and if we manage to implement it in a future version we'll let you know.
We have this API to set an author document filter and from what I looked in our code you should receive a callback in the filter after the end user chose the element to surround with and pressed enter:
Maybe you can take a decision not to perform the surround in certain cases by avoiding to call super.surroundInFragment.
Regards,
Radu
We have an internal issue to enhance the "surround with" functionality, I added your feedback to it and if we manage to implement it in a future version we'll let you know.
We have this API to set an author document filter and from what I looked in our code you should receive a callback in the filter after the end user chose the element to surround with and pressed enter:
Code: Select all
authorDocumentController.setDocumentFilter(new AuthorDocumentFilter() {
/**
* @see ro.sync.ecss.extensions.api.AuthorDocumentFilter#surroundInFragment(ro.sync.ecss.extensions.api.AuthorDocumentFilterBypass, ro.sync.ecss.extensions.api.node.AuthorDocumentFragment, int, int)
*/
@Override
public void surroundInFragment(AuthorDocumentFilterBypass filterBypass,
AuthorDocumentFragment xmlFragment, int startOffset, int endOffset)
throws AuthorOperationException {
//You should receive a callback here
super.surroundInFragment(filterBypass, xmlFragment, startOffset, endOffset);
}
});
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 168
- Joined: Fri Jan 20, 2017 1:11 pm
Re: Content Completion > Surround With not schema aware
Hello Radu,
Thank you for your feedback.
Is it possible to not show this pop up in the Author view, when user select something and press Enter key ?
I think, it would be more user friendly.
User will not understand why select element in this pop up do nothing or why this pop up exist if it never works.
Thank you
Regards,
Isabelle
Thank you for your feedback.
Is it possible to not show this pop up in the Author view, when user select something and press Enter key ?
I think, it would be more user friendly.
User will not understand why select element in this pop up do nothing or why this pop up exist if it never works.
Thank you
Regards,
Isabelle
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Content Completion > Surround With not schema aware
Hi Isabelle,
About this question:
Another workaround which might work would be for you to add a key listener to the Swing component on which we render the Author visual editing mode and when your key listener is called (and it is called before we interpret the event) to consume the event in certain cases, like:
Regards,
Radu
About this question:
I don't know, when in the framework configuration you define an Author action, you can bind it to the "ENTER" shortcut, meaning your action should be called when the end user will press ENTER in the editing area. But this would mean that your action will get called no matter if there is or not selection in the editing area, which is not something that you want.Is it possible to not show this pop up in the Author view, when user select something and press Enter key ?
Another workaround which might work would be for you to add a key listener to the Swing component on which we render the Author visual editing mode and when your key listener is called (and it is called before we interpret the event) to consume the event in certain cases, like:
Code: Select all
((JComponent)authorAccess.getEditorAccess().getAuthorComponent()).addKeyListener(new KeyAdapter() {
/**
* @see java.awt.event.KeyAdapter#keyPressed(java.awt.event.KeyEvent)
*/
@Override
public void keyPressed(KeyEvent e) {
if(e.getKeyCode() == KeyEvent.VK_ENTER && authorAccess.getEditorAccess().hasSelection()) {
e.consume();
}
}
});
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Content Completion > Surround With not schema aware
Hi,
As an update we just released Oxygen 25 (and its corresponding SDK) which it should no longer propose invalid elements when using "Surround With".
Regards,
Radu
As an update we just released Oxygen 25 (and its corresponding SDK) which it should no longer propose invalid elements when using "Surround With".
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
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