Sunday, January 18, 2009, 5:50:04 PM, Hussein Shafie wrote:
> Daniel Dekany wrote:
>> When I put something into the clipboard, it will be in an XXE-specific
>> format ("<ns:clipboard" etc.), so it's only useful within XXE. (OK,
>> except if the selection didn't crossed any element boundaries.)
>
> * The "<ns:clipboard>" is added only when strictly needed, for example,
> when you copy a node range. If you just copy an element, XXE will not
> add this wrapper element.
Note that copying node ranges is totally common in practice. When you
copy a part of paragraph that contains an emphasized word or "code"
words or a link, that's already node range. Then, if you copy multiple
paragraphs, that's again a node range.
> * The XML copied to the clipboard is not indented. Indenting XML means
> adding truly ignorable whitespace, therefore it is a costly operation.
> When the XML is not indented, you have the choice between putting
> everything on one very long line or using what you call ``odd
> line-breaks''. We much prefer the ``odd line-breaks''.
OK, whatever, that's just the internally used format of XXE that no
users should ever face with. What's needed is the clipboard content
being available as plain text (no tags in it, so no indenting needed).
>> But an important goal of the clipboard is to exchange data between
>> different applications, so I think it wouldn be more convenient if
>> you put the data into the clipboard in two formats: the
>> XXE-specific format with MIME type
>> "application/x-java-serialized-object; class=you.know.What", and
>> then the selection converted to plain text. The first is possible
>> if you create a java.awt.datatransfer.Transferable that supports a
>> flavor like `new DataFlavor(you.know.What.class, "XXE")`. And the
>> text/plain format shouldn't contain any markup; think about
>> copy-pasting into a Word or an e-mail. Actually, it can be quite
>> annoying that it doesn't work, once XXE becomes your second "MS
>> Word".
>
> What you say is indeed true. However, what currently does XXE is as
> simple and as efficient as possible,
(You meant efficient for the hardware, not for the user, I assume.)
> and unless a customer pays us because she/he urgently needs this
> feature,
But I hope you don't expect that a customer will pop up one day and
offer you to pay specifically for implementing a basic/usual text
editor functionality in a text editor... :)
> we are not going to implement it in the near future.
You know what's your schedule of course, but what's missing? You
already have `copyChars [separateParagraphs]`. That's good enough for
now, I guess. So you only need the clipboard "magic" of using multiple
formats (plain text + XXE specific), I guess. If the problem is that
you don't want to spend time with figuring that out (silly API-s), I
can write and send the easy-to-reuse example code for that (under
public domain, and with my employer being totally out of the picture),
which you can also immediately run and see if it works on your test
configs, and if it works, take a quick look at the short code to see
it's not malware, integrate it into XXE in no time. And that's it.
Done. Users are celebrating all around the globe. :) And me don't have
remember to call copyChars instead of doing a Ctrl+C.
You also must have the code to create the nicely formatted XML source,
as the Helper Application stuff uses that. Low hanging fruits these
are.
> Workaround: how to copy the selection as plain text:
>
> * If you are a Unix user, use the System Selection to copy and paste
> plain text between XXE and other applications.
>
> Selected chars are automatically added to the System Selection (That is,
> no need to select Edit|Copy). The contents of the System Selection can
> then be pasted by clicking the middle mouse button.
>
> * Otherwise, use command copyChars. See
> http://www.xmlmind.com/xmleditor/_distrib/doc/commands/copyChars.html
>
> - This command is currently not bound to a keystroke. You can run it
> using "Tools|Execute Command". See "Execute Command" in
> http://www.xmlmind.com/xmleditor/_distrib/doc/help/toolsMenu.html
>
> - If you have Professional Edition, you can bind this command to a
> keystroke of your choice. See "Add Keyboard Shortcut" in
> http://www.xmlmind.com/xmleditor/_distrib/doc/help/optionsMenu.html#customizeConfigurationMenu
>
>> However, you may often want to copy-paste XML markup from XXE edited
>> stuff (without all those ns:clipboards and odd line-breaks of course),
>> so most certainly a "Edit / Copy XML source" command should exist
>> under "Edit / Copy". (I needed this last a lot when working both with
>> XXE-edited and non-XXE-edited XML-s at once.)
>>
>
> In fact, you need both "Copy as Plain Text" and "Copy as Indented XML".
>
> If there is sufficient interest,
(That's difficult to measure. If there is a workaround, users seldom
say a word. Still, when you ask someone why he has chosen software X
over software Y, they will often say X is more *convenient* when doing
this-and-that... trivial things often.)
> we could implement these commands in
> the menu of the Clipboard tool (found at the bottom/right of the main
> window. See
> http://www.xmlmind.com/xmleditor/_distrib/doc/help/clipboardTool.html).
Users will find that there? I bet they will first look under Edit.
Also, no need for "Copy as Plain Text" as that should be the default
thing. Like, try Edit/Copy in MS Word, OpenOffice Write, in fact,
whatever text editor applications but XXE. Unless you paste into some
rich-text application, it's always plain text that comes from the
clipboard. And that's not just a legacy, it's practical that way. (And
please don't add with RTF and HTML format to the clipboard, because
that's highly annoying... Yeah, I know, I don't have to ask that. :) )
> --
> XMLmind XML Editor Support List
> xmleditor-support at xmlmind.com
> http://www.xmlmind.com/mailman/listinfo/xmleditor-support
--
Best regards,
Daniel Dekany