Autocompletion: Attributes list

Post here questions and problems related to oXygen frameworks/document types.
sebastienlavandier
Posts: 124

Autocompletion: Attributes list

Wed Oct 23, 2013 11:49 am

Hi,
I work with the author component.

I created a button/action for add an specific attribute to a specific node.
Now, I want list all the possible "ID" (all the alredy referenced ID) in a list like It's do when I write a new attribute in text/author mode.

Could you help me ?
Thanks in advance for you r help.

Sébastien
Radu
Posts: 5987

Re: Autocompletion: Attributes list

Wed Oct 23, 2013 12:33 pm

Hi Sébastien,

You can run XPaths over the entire document using API like this:

ro.sync.ecss.extensions.api.AuthorDocumentController.evaluateXPath(String, boolean, boolean, boolean)

So you can run an XPath which lists all IDs in the document and then add them to a list which is presented to the user.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
sebastienlavandier
Posts: 124

Re: Autocompletion: Attributes list

Wed Oct 23, 2013 2:51 pm

I can't implemented an existing action to access to the Oxygen list ?

Sébastien
Radu
Posts: 5987

Re: Autocompletion: Attributes list

Wed Oct 23, 2013 3:12 pm

Hi,

You could also try something like this:

Code: Select all

AuthorSchemaManager sm = authorAccess.getDocumentController().getAuthorSchemaManager();
AuthorElement currentElement = ....;
WhatPossibleValuesHasAttributeContext ctxt = sm.createWhatPossibleValuesHasAttributeContext(currentElement, "id");
List<CIValue> vals = sm.whatPossibleValuesHasAttribute(ctxt);


Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Return to “SDK-API, Frameworks - Document Types”

Who is online

Users browsing this forum: No registered users and 1 guest