Page 1 of 1
Content Assist Extension - Element Values
Posted: Wed Feb 29, 2012 1:50 pm
by DanielH
Hi,
I am currently writing an extension for oXygen that will allow me to add entries to the content assist pop up after CTRL + Space is pressed.
I have already set up the extension OK, however when I add CIValue objects (through filterElementValues of SchemaManagerFilter) I cannot change the 'Value' part (see image) when the new element value is selected in the Content Assistant.
http://s12.postimage.org/p02gj2qej/content_complete.png
I am missing a piece of API? or can this value not be changed?
Re: Content Assist Extension - Element Values
Posted: Wed Feb 29, 2012 3:43 pm
by Radu
Hi,
Do you mean in the yellow-background Documentation window?
Each CIValue has an annotation which can be set:
ro.sync.contentcompletion.xml.CIValue.setAnnotation(String)
That annotation value is then presented in the documentation window which is docked by the side of the content completion window.
Regards,
Radu
Re: Content Assist Extension - Element Values
Posted: Wed Feb 29, 2012 6:54 pm
by DanielH
Hi Radu,
Thank you for your quick response.
Yes, I did mean the yellow-background, I have tried setting the annotation via the constructor as well as setAnnotation method but I am having no luck in getting it working. The Documentation window just says 'Value'.
This is what I am doing:
Code: Select all
String sentenceToInsert = "test";
String documentation = "some documentation";
CIValue suggestion = new CIValue(sentenceToInsert, documentation);
elementValues.add(suggestion);
The result is that a new entry appears in the list to select, the entry saying: 'test', but the Documentation window still says 'Value' instead of 'some documentation'. I have also tried using the setter too, but again no luck. Have you got any suggestions on how to proceed?
I am using v13.2.
Re: Content Assist Extension - Element Values
Posted: Thu Mar 01, 2012 11:51 am
by Radu
Hi Daniel,
You are right, I tested and this is a bug in Oxygen, the documentation value remains fixed as Value instead of using the annotation that you set using the API.
We'll fix this issue in Oxygen 14 (which will probably be released this summer).
Regards,
Radu
Re: Content Assist Extension - Element Values
Posted: Thu Mar 01, 2012 12:11 pm
by SSC
Hi,
this thread sounds interesting.
Do you have some sample code how the Oxygen Content Assist can be appended by custom items in the eclipse plugin?
Maybe this could be also useful for uns some time.
Thanks in advance.
Regards,
Simon
Re: Content Assist Extension - Element Values
Posted: Thu Mar 01, 2012 12:40 pm
by Radu
Hi Simon,
Basically the interface which can be implemented in order to provide custom attribute or element values or even additional attributes and elements for content completion is this:
ro.sync.contentcompletion.xml.SchemaManagerFilter
Either you edit the document type and in the Extensions tab set your implementation class as the Content completion handler or in your ExtensionsBundle implementation you can overwriting this method:
ro.sync.ecss.extensions.api.ExtensionsBundle.createSchemaManagerFilter()
Regards,
Radu
Re: Content Assist Extension - Element Values
Posted: Thu Mar 01, 2012 1:29 pm
by DanielH
Thanks again for the response Radu, is there any possibility of a patch that I could apply to oXygen myself? or a pointer on where to look so I can patch it myself? I'm using the oXygen Author Eclipse plugin.
Simon: The Oxygen user manual has some examples of adding additional elements and attributes to content assist:
http://www.oxygenxml.com/doc/AuthorEcli ... Manual.pdf, page 204 onwards, plus the SDKs have sample java files.
Re: Content Assist Extension - Element Values
Posted: Thu Mar 01, 2012 1:33 pm
by Radu
Hi Daniel,
If you give us some contact details via the support email address
support@oxygenxml.com I will try to provide you with a patch for Oxygen 13.2 Author for Eclipse plugin in a couple of days.
Regards,
Radu
Re: Content Assist Extension - Element Values
Posted: Tue Mar 13, 2012 5:33 pm
by adrian
Hello,
This problem has been resolved in the latest maintenance build of Oxygen 13.2, 2012030716:
Author mode: Annotations were not correctly shown for element values from the content completion list.
You can download it from our web site:
http://www.oxygenxml.com/download.html
The list of bug-fixes can be found here:
http://www.oxygenxml.com/build_history.html#2012030716
Regards,
Adrian
Re: Content Assist Extension - Element Values
Posted: Tue Mar 13, 2012 5:39 pm
by DanielH
Thanks once more for your quick replies and fixes.
Regards,
Daniel