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 » Wed Feb 29, 2012 1:50 pm

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: 7094
Joined: Fri Jul 09, 2004 5:18 pm

Re: Content Assist Extension - Element Values

Post by Radu » Wed Feb 29, 2012 3:43 pm

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 » Wed Feb 29, 2012 6:54 pm

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: 7094
Joined: Fri Jul 09, 2004 5:18 pm

Re: Content Assist Extension - Element Values

Post by Radu » Thu Mar 01, 2012 11:51 am

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 » Thu Mar 01, 2012 12:11 pm

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: 7094
Joined: Fri Jul 09, 2004 5:18 pm

Re: Content Assist Extension - Element Values

Post by Radu » Thu Mar 01, 2012 12:40 pm

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 » Thu Mar 01, 2012 1:29 pm

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: 7094
Joined: Fri Jul 09, 2004 5:18 pm

Re: Content Assist Extension - Element Values

Post by Radu » Thu Mar 01, 2012 1:33 pm

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: 2666
Joined: Tue May 17, 2005 4:01 pm

Re: Content Assist Extension - Element Values

Post by adrian » Tue Mar 13, 2012 5:33 pm

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 » Tue Mar 13, 2012 5:39 pm

Thanks once more for your quick replies and fixes.

Regards,
Daniel

Post Reply