Override / remove standard actions from content completion menu

Post here questions and problems related to oXygen frameworks/document types.
Johann
Posts: 198
Joined: Wed Jun 17, 2015 12:46 pm

Override / remove standard actions from content completion menu

Post by Johann »

Hello,

I am using Oxygen component 24.0.0.2 version.

My goal is that when I insert a particular element ("myElement"), an attribute and a value is added automatically.
I would like to be able to do this without java code, just by configuring the framework.

So, I created my custom authorAction based on InsertFragmentOperation with the desired fragment.
Then, I put in contentCompletion :

Code: Select all

<contentCompletion xmlns="http://www.oxygenxml.com/ns/framework/extend">
  <authorActions>
    <addAction id="myCustomAction" replacedElement="myElement" useReplaceElementName="true" inCCWindow="true"/>
  </authorActions>
</contentCompletion>
It works well but "myElement" is an item of a list. So, when the cursor is inside a "myElement" and when the user hits "Enter", the content completion menu proposes "New myElement" action which does not perform my custom action (without the desired attribute).
It is the same issue with a "Split myElement" action.

So, my questions are :
- Is it possible to override these "standard" actions without java code?
or
- Is it possible to remove these "standard" actions from the Content Completion menu only for myElement?

Thank you,

Johann
mihaela
Posts: 490
Joined: Wed May 20, 2009 2:40 pm

Re: Override / remove standard actions from content completion menu

Post by mihaela »

Hello,

Unfortunately it is not possible for the moment to use the framework configuration file to replace or remove the Split element or New element actions from the content completion.
We added an issue in our internal issue tracker to implement this feature. We will update this thread when this will be available.

Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
alex_jitianu
Posts: 1008
Joined: Wed Nov 16, 2005 11:11 am

Re: Override / remove standard actions from content completion menu

Post by alex_jitianu »

Hello,

We've just released Oxygen 25 and in it you can remove SPLIT/NEW entries like this:

Code: Select all

<author>
    <contentCompletion>
      <schemaProposals>
        <removeProposal renderName="&lt;SPLIT> p" fromCCWindow="true"/>
      </schemaProposals>
    </contentCompletion>
  </author>
I hope it helps!
Best regards,
Alex
Post Reply