Use "Specific Element Icons" in own framework
Oxygen general issues.
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Use "Specific Element Icons" in own framework
Hi Patrick,
You are talking about the possibility to customize icons in the Outline view using our Java API, right?
We have a new API interface called:
If you edit a document type, in the Extensions tab you can now set your own implementation of a customizer.
As an example, in our Author SDK you can look at how the:
customizer works for providing custom icons in the Outline when editing XHTML files.
Using the API you can also change the display name and tooltip of the elements presented in the Outline.
Regards,
Radu
You are talking about the possibility to customize icons in the Outline view using our Java API, right?
We have a new API interface called:
Code: Select all
ro.sync.exml.workspace.api.node.customizer.XMLNodeRendererCustomizer
As an example, in our Author SDK you can look at how the:
Code: Select all
ro.sync.ecss.extensions.xhtml.XHTMLNodeRendererCustomizer
Using the API you can also change the display name and tooltip of the elements presented in the Outline.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Use "Specific Element Icons" in own framework
Hi Patrick,
You should look over the JavaDoc from the API method:
this.getClass().getResource("/images/Icon.gif").toExternalForm();
Or you could try to use editor variables to express the path to the image like:
${frameworks}/myFramework/images/myImage.png
Regards,
Radu
You should look over the JavaDoc from the API method:
Code: Select all
ro.sync.exml.workspace.api.node.customizer.BasicRenderingInformation.setIconPath(String)
So if you have the image in an "images" folder in the same JAR as the XMLNodeRendererCustomizer you could get its URL like:Set the path of the icon used to render a node. The path can be an icon file path, the string representation of an icon URL or can contain editor variables as defined in the EditorVariables class. The editor variables will be expanded at runtime. If the icon path is null the default icon will be used for the node.
If the custom used images are located in the same jar file as the XMLNodeRendererCustomizer then you can use as the return value for this function the following code sequence:
this.getClass().getResource("/images/Icon.gif").toExternalForm();
The previous sequence assumes that Icon.gif icon image is located in the images folder inside your jar file.
this.getClass().getResource("/images/Icon.gif").toExternalForm();
Or you could try to use editor variables to express the path to the image like:
${frameworks}/myFramework/images/myImage.png
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 96
- Joined: Mon May 09, 2011 11:54 am
Re: Use "Specific Element Icons" in own framework
Hi Radu,
the images is in but
does not work.
Thanks,
Patrick
the images is in
Code: Select all
frameworks/myframework/templates/icons/my_16.gif
Code: Select all
nameToIconPath.put("document", getImageURL("${framework}/templates/icons/my_16.gif"));
Thanks,
Patrick
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Use "Specific Element Icons" in own framework
Hi Patrick,
Indeed using the ${framework} editor variable does not work (but we'll fix this), that's why I suggested you using the "${frameworks}/myframework/templates/icons/my_16.gif" approach.
Regards,
Radu
Indeed using the ${framework} editor variable does not work (but we'll fix this), that's why I suggested you using the "${frameworks}/myframework/templates/icons/my_16.gif" approach.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Use "Specific Element Icons" in own framework
Hi Patrick,
First of all, we fixed the problem with not expanding the ${framework} variable and a fix will be available in a couple of weeks in the next Oxygen 14.0 minor bug fix which is announced in this RSS feed:
http://www.oxygenxml.com/rssBuildID.xml
The "${frameworks}" approach does not work if you install the framework using an update site approach (instead of copying it to the frameworks directory). And from previous conversations on our support email address it seems that this would be the case.
Then you would have two more approaches:
1) Bundle the images in the extension JAR and create the URL to them like:
2) Obtain the URL which points to the current node customizer class:
This URL has a "jar:file:" protocol but you can obtain from it the URL which points to the JAR file, then use it to point to the image.
Regards,
Radu
First of all, we fixed the problem with not expanding the ${framework} variable and a fix will be available in a couple of weeks in the next Oxygen 14.0 minor bug fix which is announced in this RSS feed:
http://www.oxygenxml.com/rssBuildID.xml
The "${frameworks}" approach does not work if you install the framework using an update site approach (instead of copying it to the frameworks directory). And from previous conversations on our support email address it seems that this would be the case.
Then you would have two more approaches:
1) Bundle the images in the extension JAR and create the URL to them like:
Code: Select all
this.getClass().getResource("/images/Icon.gif").toExternalForm()
Code: Select all
String classResource = this.class.getName().replace(".", "/") + ".class";
URL currentClassLocation = this.class.getClassLoader().getResource(classResource);
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 96
- Joined: Mon May 09, 2011 11:54 am
Re: Use "Specific Element Icons" in own framework
Hi Radu,
this framework is installed classic to the framework directory, not with the add-on-feature. If I use ${frameworks}/myFramework/images/myImage.png, e.g. for an author action in the framework configuration, the icon is displayed correctly. Only in the jar file it does not work.
But I try to use the version with the class location.
this framework is installed classic to the framework directory, not with the add-on-feature. If I use ${frameworks}/myFramework/images/myImage.png, e.g. for an author action in the framework configuration, the icon is displayed correctly. Only in the jar file it does not work.
But I try to use the version with the class location.
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Use "Specific Element Icons" in own framework
Hi Patrick,
The "${frameworks}" approach worked for me.
My implementation was something very basic like:
I added the JAR with the compiled class to the document type's classpath, added by implementation as an extension and opened a DITA topic.
The icon "myImage.png" was used both in the Outline and in the content completion window.
Maybe you have a different expectation of where the icons should appear.
Regards,
Radu
The "${frameworks}" approach worked for me.
My implementation was something very basic like:
Code: Select all
public class XMLNodeCustomizerImpl extends XMLNodeRendererCustomizer {
@Override
public BasicRenderingInformation getRenderingInformation(
NodeRendererCustomizerContext arg0) {
BasicRenderingInformation bri = new BasicRenderingInformation();
bri.setIconPath("${frameworks}/dita/images/myImage.png");
return bri;
}
@Override
public String getDescription() {
return "MY CUSTOMIZER";
}
}
The icon "myImage.png" was used both in the Outline and in the content completion window.
Maybe you have a different expectation of where the icons should appear.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Use "Specific Element Icons" in own framework
Hello,
I just wanted to let you know that this problem with not expanding the ${framework} variable has been resolved in the latest maintenance build of Oxygen 14.0, 2012082911 (released on August 30th):
http://www.oxygenxml.com/download.html
The list of bug-fixes can be found here:
http://www.oxygenxml.com/build_history.html#2012082911
You can follow the release/build RSS feed here:
http://www.oxygenxml.com/rssBuildID.xml
Let us know if you encounter further problems with this new build.
Regards,
Adrian
I just wanted to let you know that this problem with not expanding the ${framework} variable has been resolved in the latest maintenance build of Oxygen 14.0, 2012082911 (released on August 30th):
You can download it from our web site:Author API: ro.sync.exml.workspace.api.node.customizer.BasicRenderingInformation.setIconPath(String) did not expand the ${framework} editor variable from the path provided as argument.
http://www.oxygenxml.com/download.html
The list of bug-fixes can be found here:
http://www.oxygenxml.com/build_history.html#2012082911
You can follow the release/build RSS feed here:
http://www.oxygenxml.com/rssBuildID.xml
Let us know if you encounter further problems with this new build.
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
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ 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