How to customize "Show Definition" (or Quick Assist) feature for my own framework?
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 22
- Joined: Tue Oct 17, 2017 5:05 pm
How to customize "Show Definition" (or Quick Assist) feature for my own framework?
Post by serioadamo97 »
For example, in XSLT we have following code:
When we place the cursor inside "foo" , we can click "Show Definition" button (or use Quick Assist) and then the cursor will jump to definition.
My question is how to customize "Show Definition" (or Quick Assist) feature for my own framework?
I know that using ID/IDREF(https://www.oxygenxml.com/doc/versions/ ... odes2.html) can implement this feature. But ID/IDREF has a lot of restrictions.(eg: D/IDREF must be unique globally and it does not support scoping-based symbol find.)
Thanks.
Code: Select all
<xsl:template match="/">
<xsl:call-template name="foo"/>
</xsl:template>
<xsl:template name="foo">
<foo></foo>
</xsl:template>
My question is how to customize "Show Definition" (or Quick Assist) feature for my own framework?
I know that using ID/IDREF(https://www.oxygenxml.com/doc/versions/ ... odes2.html) can implement this feature. But ID/IDREF has a lot of restrictions.(eg: D/IDREF must be unique globally and it does not support scoping-based symbol find.)
Thanks.
Re: How to customize "Show Definition" (or Quick Assist) feature for my own framework?
Hi,
The implementation is completely different for each specialized editor. For XML files "Show Definition" will go to the schema and show you where that element or attribute is declared. For XSL it's implemented differently and shows the definition of the respective variable, template or function.
Regards,
Adrian
In short you can't, it's not customizable, there's no API to redefine its behavior.My question is how to customize "Show Definition" (or Quick Assist) feature for my own framework?
The implementation is completely different for each specialized editor. For XML files "Show Definition" will go to the schema and show you where that element or attribute is declared. For XSL it's implemented differently and shows the definition of the respective variable, template or function.
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 22
- Joined: Tue Oct 17, 2017 5:05 pm
Re: How to customize "Show Definition" (or Quick Assist) feature for my own framework?
Post by serioadamo97 »
Hi Adrian,adrian wrote:Hi,
In short you can't, it's not customizable, there's no API to redefine its behavior.My question is how to customize "Show Definition" (or Quick Assist) feature for my own framework?
The implementation is completely different for each specialized editor. For XML files "Show Definition" will go to the schema and show you where that element or attribute is declared. For XSL it's implemented differently and shows the definition of the respective variable, template or function.
Regards,
Adrian
Thanks for your answer.
I found some document on oxygenxml website:
https://www.oxygenxml.com/doc/versions/ ... inder.html
It says that :
The link target reference finder represents the support for finding references from links that indicate specific elements inside an XML document.
Is this can implement this feature? (Or I understand what it meant?)
Re: How to customize "Show Definition" (or Quick Assist) feature for my own framework?
Hi,
Adrian asked me to help you with this.
So if you implement a workspace access plugin for Oxygen:
https://www.oxygenxml.com/doc/versions/ ... lugin.html
You can add a menus and toolbars customizer:
https://www.oxygenxml.com/InstData/Edit ... mizer.html
which allows you to customize the popup menu for the text page:
customizeTextPopUpMenu(javax.swing.JPopupMenu popUp, WSTextEditorPage textPage)
If the opened document is XML, the "textPage" can actually be cast to ro.sync.exml.workspace.api.editor.page.text.xml.WSXMLTextEditorPage which gives you access to more API (for example execute XPath expressions).
You also have access to the caret offset WSTextBasedEditorPage.getCaretOffset() and even to the Swing JTextArea "WSTextEditorPage.getTextComponent()".
So you could try to add a contextual menu action which when pressed could look in the current document and then try to open another document at another location using an API like "ro.sync.exml.workspace.api.Workspace.open(URL)".
If that URL contains a custom anchor inside it like:
"file:/.../test.xml#myCustomAnchor"
then the job of finding the place in the opened XML document is then delegated to the link target element finder for which you already found a resource:
https://www.oxygenxml.com/doc/versions/ ... inder.html
Regards,
Radu
Adrian asked me to help you with this.
So if you implement a workspace access plugin for Oxygen:
https://www.oxygenxml.com/doc/versions/ ... lugin.html
You can add a menus and toolbars customizer:
Code: Select all
ro.sync.exml.workspace.api.standalone.StandalonePluginWorkspace.addMenusAndToolbarsContributorCustomizer(MenusAndToolbarsContributorCustomizer)
which allows you to customize the popup menu for the text page:
customizeTextPopUpMenu(javax.swing.JPopupMenu popUp, WSTextEditorPage textPage)
If the opened document is XML, the "textPage" can actually be cast to ro.sync.exml.workspace.api.editor.page.text.xml.WSXMLTextEditorPage which gives you access to more API (for example execute XPath expressions).
You also have access to the caret offset WSTextBasedEditorPage.getCaretOffset() and even to the Swing JTextArea "WSTextEditorPage.getTextComponent()".
So you could try to add a contextual menu action which when pressed could look in the current document and then try to open another document at another location using an API like "ro.sync.exml.workspace.api.Workspace.open(URL)".
If that URL contains a custom anchor inside it like:
"file:/.../test.xml#myCustomAnchor"
then the job of finding the place in the opened XML document is then delegated to the link target element finder for which you already found a resource:
https://www.oxygenxml.com/doc/versions/ ... inder.html
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 22
- Joined: Tue Oct 17, 2017 5:05 pm
Re: How to customize "Show Definition" (or Quick Assist) feature for my own framework?
Post by serioadamo97 »
Thanks, it works.
But finally, I used the XPath expression instead of developing extra plug-ins to implement the feature of Show Definition.
But finally, I used the XPath expression instead of developing extra plug-ins to implement the feature of Show Definition.
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