Hi Hussein,

Thanks a lot for the quick reply.
I thought that there may be an easy way to override the standard paste behavior 
with. macro commands. 
I suppose we will skip that requirement since it is not clear how that 
functionality should work if there is other data than text before or after the 
caret.

Thanks,
Roman

--------------------------
Sent from my BlackBerry Wireless Device

----- Originalnachricht -----
Von: xmleditor-support-bounces at xmlmind.com <xmleditor-support-bounces at 
xmlmind.com>
An: Huditsch, Roman (LNG-VIE)
Cc: xmleditor-support at xmlmind.com <xmleditor-support at xmlmind.com>
Gesendet: Thu Nov 06 15:26:43 2008
Betreff: Re: [XXE] Pasting text with whitespace adjustment/balancing

Huditsch, Roman (LNG-VIE) wrote:
> 
> I got the following requirement from our others:
> When they cut (or copy) text and paste it in somewhere else in XMLMind, 
> they want that to happen with some kind of whitespace adjustment or
> balancing.
> So if the text before the caret doesn't end with a whitespace, then the
> pasted text
> should be filled in with a leading space. The same applies to the text
> after the caret - 
> just the other way around.
> 
> Example 1: 
> 
>       Text in clipboard: "warranty"
>       Text before caret in text: "subject to the Limited"
>       Text after the caret:  "on Optical Storage Products"
>       Text after pasting: "subject to the Limited warranty on Optical
> Storage Products"
> 
> 
> Example 2:
> 
>       Text in clipboard: "warranty"
>       Text before caret in text: "subject to the Limited "
>       Text after the caret:  " on Optical Storage Products"
>       Text after pasting: "subject to the Limited warranty on Optical
> Storage Products"
> 
> Example 3:
> 
>       Text in clipboard: " warranty "
>       Text before caret in text: "subject to the Limited"
>       Text after the caret:  "on Optical Storage Products"
>       Text after pasting: "subject to the Limited warranty on Optical
> Storage Products"
> 

I understand this requirement.



> 
> Is there any way in XMLMind to do this? 
> 

There is no easy and safe way to implement this feature in XMLmind XML
Editor.

Of course, it is always possible to specialize the standard Paste
command (
http://www.xmlmind.com/xmleditor/_distrib/doc/api/com/xmlmind/xmledit/cmd/edit/Paste.html
) after reading its source code and to rebind your specialization to
Ctrl-V.

However, you need to be an experienced Java[tm] programmer to do this
and, even in this case,  it is not that simple to do it and you can
easily break things.

Note that having too much whitespace around pasted text is not really a
problem as whitespace is automatically normalized each time a document
is opened.


 
--
XMLmind XML Editor Support List
xmleditor-support at xmlmind.com
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to