Adding ask editor variable type
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 24
- Joined: Tue Jun 05, 2012 10:34 am
Adding ask editor variable type
Hi, i'm working on a custom frameworks and I'm trying to use a ChangeAttributeOperation, and prompt the value to the end user.
The user should be able to change the text size and color of the current element, so this will output a color and size attributes.
This is actually working using
${ask('Color', editable_combobox, ('red':'Red';'blue':'Blue';'green':'Green'), '')}
and
${ask('Size')}
But this is a bit primitive, as the user is able to input whatever he wants.
Is there a way to customize the ask function or can I create a new one, to limit the input to numbers with min and max value for the size, and display a java color picker for the color ?
Thank you.
The user should be able to change the text size and color of the current element, so this will output a color and size attributes.
This is actually working using
${ask('Color', editable_combobox, ('red':'Red';'blue':'Blue';'green':'Green'), '')}
and
${ask('Size')}
But this is a bit primitive, as the user is able to input whatever he wants.
Is there a way to customize the ask function or can I create a new one, to limit the input to numbers with min and max value for the size, and display a java color picker for the color ?
Thank you.
-
- Posts: 417
- Joined: Mon May 09, 2016 9:37 am
Re: Adding ask editor variable type
Post by sorin_carbunaru »
Hello,
If you would be willing to write some Java code, then you could add an EditorVariablesResolver using the API, and this way you can create your own variables.
If you want to see a simple example, you can take a look at this class from our Git Client Add-on.
All the best wishes,
Sorin Carbunaru
Oxygen XML Editor
If you would be willing to write some Java code, then you could add an EditorVariablesResolver using the API, and this way you can create your own variables.
If you want to see a simple example, you can take a look at this class from our Git Client Add-on.
All the best wishes,
Sorin Carbunaru
Oxygen XML Editor
-
- Posts: 24
- Joined: Tue Jun 05, 2012 10:34 am
Re: Adding ask editor variable type
Thank you for suggestion, I'm testing a simplier approach using standard configuration, but this is a good option.
What i'm testing for now, is to configure the color list in an external file, such as :
and below is the value in action configuration, this works pretty well, it is configurable, and cheaper than a cool UI color picker.
What i'm testing for now, is to configure the color list in an external file, such as :
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<properties>
<entry key="style.colors">"'red':'Red';'blue':'Blue';'green':'Green'"</entry>
</properties>
Code: Select all
${ask(
'${i18n(style.choose.color)}',
editable_combobox,
(${xpath_eval(
if (doc-available('file:///${homeDir}/.authorNeo/AESTATWorkspace/AESTATProperties.xml'))
then string(doc('file:///${homeDir}/.authorNeo/AESTATWorkspace/AESTATProperties.xml')/*:properties/*:entry[@key="style.colors"]/text())
else "'red':'Red';'blue':'Blue';'green':'Green'"
)})
)}
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