Bernd Kuemmerlen wrote:
> 
> I am currently trying to find a way to implement the behaviour I
> described in a previous mail on this list ("Copy/Paste issues") using
> the configuration features of xxe.
> 
> I have had a good look at the Power Users Guide and I have found several
> starting points, but I am not quite sure if what I want can really be
> done through the configuration. Let me describe it quickly:
> For DocBook, I want to make it easier for the user to select portions of
> the text with the complete markup for copy/paste operations. With the
> Ctrl-Click and Shift-Ctrl-Click selection, you currently only can select
> direct siblings as far as I can tell. My question is: Is it (in
> principle) possible, just by using macros in the configuration, to
> implement the following:
> 
> - If the user Shift-Ctrl-Clicks on a node and another node is already
> selected, do the following:
>    1. If the two nodes are siblings, select the node range between them
>       (just like "selectNodeAt extend" does)
>    2. If the two nodes are not siblings, instead of the second node,
>       select its parent node, then go back to 1.
> 
> I am not sure if a behaviour like this is possible, but I would be
> greatful for any hints on this.

No, you cannot do that by defining a macro-command, you need to write a
new command in Java or in one of the supported scripting language
(BeanShell recommended).

The main reason is that unlike selectNode, the selectNodeAt command has
not been designed as a reusable tool. For example, if "selectNodeAt
extend" cannot do its job, it will do nothing at all instead of
reporting the fact that it cannot do it.

Writing a command will be described in the Developer's Guide (next
release, expected at the end of this month). (For example, selectNodeAt
is 100 lines of Java.)

PS: note that even if you write a new command you cannot bind it to
Shift-Ctrl-Click because, for now, it is not allowed to override
standard bindings, just to augment them.

Reply via email to