Content Assist Extension - Element Values

Oxygen general issues.
DanielH
Posts: 14
Joined: Tue Sep 27, 2011 11:29 am

Content Assist Extension - Element Values

Post 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?
Radu
Posts: 9048
Joined: Fri Jul 09, 2004 5:18 pm

Re: Content Assist Extension - Element Values

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
DanielH
Posts: 14
Joined: Tue Sep 27, 2011 11:29 am

Re: Content Assist Extension - Element Values

Post 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.
Radu
Posts: 9048
Joined: Fri Jul 09, 2004 5:18 pm

Re: Content Assist Extension - Element Values

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
SSC
Posts: 206
Joined: Thu Dec 01, 2011 4:22 pm
Location: Hamburg, Germany

Re: Content Assist Extension - Element Values

Post 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
Simon Scholz
vogella GmbH
http://www.vogella.com
Radu
Posts: 9048
Joined: Fri Jul 09, 2004 5:18 pm

Re: Content Assist Extension - Element Values

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
DanielH
Posts: 14
Joined: Tue Sep 27, 2011 11:29 am

Re: Content Assist Extension - Element Values

Post 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.
Radu
Posts: 9048
Joined: Fri Jul 09, 2004 5:18 pm

Re: Content Assist Extension - Element Values

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: Content Assist Extension - Element Values

Post 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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
DanielH
Posts: 14
Joined: Tue Sep 27, 2011 11:29 am

Re: Content Assist Extension - Element Values

Post by DanielH »

Thanks once more for your quick replies and fixes.

Regards,
Daniel
Post Reply