Custom actions in content completion dialog

Oxygen general issues.
xsaero00
Posts: 58
Joined: Sat Aug 01, 2009 12:57 am

Custom actions in content completion dialog

Post by xsaero00 »

We want to implement custom actions in content completion dialog similar to "Split listitem" that comes up if you press ctrl + space with cursor inside <para> of <listitem>. This action seems to be custom since the cursor is not inside the <listitem> but inside the <para>.


I looked in DocBook code and could not find the code responsible for adding that custom action. We want to implement similar behavior in bibliography section. There we have <bibliomixed> with <bibliomset> inside. How do we replicate list behavior.

I noticed that it may be possible to do what I want using custom action and content completion modification in document type customization, but before I go that rout I'd like to know how <listitem> does it.
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Custom actions in content completion dialog

Post by Radu »

Hi Mike,

The Split action in the Author is generically implemented (does not depend on the type of document type you are editing in).

If the element in which you press ENTER is a display:inline element then the split is proposed on the nearest display:block element (as defined in the CSS file).
Another rule we added was that if the current element is BLOCK but its parent is of display list-item then we propose as first entry to split the parent list item.

If I understand correctly, in your case the caret is placed inside <bibliomixed> and you press ENTER, is this correct?
The <bibliomixed> is defined in the CSS as a block so you only get the option to split <bibliomixed>.

If you are using Oxygen 12.2 you can replace our "Split" action completely with one of your Author operations (we have a client who'se done this) but there would be probably a lot of code to write on your side.

In Oxygen 12.2 we added the possibility in the Document Type Edit dialog in the "Author" tab to provide custom Author action on the content completion. Based on the XPath expression you wrote for the Author action the content completion window will show it or not when invoked in a certain context.

You can also remove entries which appear by default in the content completion window (thus you could remove the special <SPLIT> entry).

What you could at least do would be to create a custom Author action for splitting a <bibliography> with a restrictive XPath and then add this action to the content completion window.

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