Disable All Contextual Menu Items created by Oxygen

Oxygen general issues.
asynchronousDev
Posts: 7
Joined: Fri Jul 12, 2013 8:54 pm

Disable All Contextual Menu Items created by Oxygen

Post by asynchronousDev »

I would like to remove all of the contextual menu items automatically generated by Oxygen using the schema, leaving only the ones that I have defined myself. The items are the contextual menu items found below the user defined item and are preceded by a solid blue dot and are the ones that Oxygen puts in there for you automatically.

I understand that I can remove them myself, but I am trying to circumvent having to remove each and every undesired item individually through the preferences pane.

I have tried unchecking the "Show all possible elements in the context completion list" option in the "Schema Aware Actions" within preferences, but that does not seem to work as I expected.

I would prefer the ability to do this programmatically using the API, but would settle for a place in the user settings that would allow me to toggle the feature.
alex_jitianu
Posts: 1017
Joined: Wed Nov 16, 2005 11:11 am

Re: Disable All Contextual Menu Items created by Oxygen

Post by alex_jitianu »

Hello,

You can remove all the content completion items provided by Oxygen and replace them with yours by using our JAVA API. The class that you need to implement is SchemaManagerFilter and an example can be found here [1]. You can configure it in your Document Type Association using the Extensions tab from the Document Type dialog [2].

The "Show all possible elements in the context completion list" option tells Oxygen to show in the content completion menu all global elements defined in the schema, even if they are not valid at the insertion position. If not valid at the current caret position, the smart insert strategies will try to find a valid position for the element in a position near to the caret position.


[1] http://oxygenxml.com/doc/ug-editor/#top ... ndler.html
[2] http://oxygenxml.com/doc/ug-editor/#tas ... sions.html

Thanks,
Alex
asynchronousDev
Posts: 7
Joined: Fri Jul 12, 2013 8:54 pm

Re: Disable All Contextual Menu Items created by Oxygen

Post by asynchronousDev »

Thanks for the quick response. I found this solution by searching the forum, so thank you for confirming that.

Is there anyway to use the API to filter the Oxygen suggestions, but leave the already created items I have defined in the frameworks file?
alex_jitianu
Posts: 1017
Joined: Wed Nov 16, 2005 11:11 am

Re: Disable All Contextual Menu Items created by Oxygen

Post by alex_jitianu »

Hello,

The SchemaManagerFilter API will only filter the Oxygen's schema based suggestions. It will not affect any author actions you've added in the content completion from the Document Type configuration dialog.

Best regards,
Alex
Radu
Posts: 9472
Joined: Fri Jul 09, 2004 5:18 pm

Re: Disable All Contextual Menu Items created by Oxygen

Post by Radu »

Hi,

Starting with Oxygen 16.0 the list of items to remove from the content completion window configured in the Document Type/framework allows simple patterns so for example to remove all items you could use something like *.

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