改行コードを除いてコピーをしたい

【ご質問】
テキストの文字列を選択し、「Crtl+C」を押下した際に
選択した文字列内の改行コードを除いてコピーすることは可能でしょうか?

【回答】
CopyCommandクラスを継承したクラスのexecuteメソッドに
おいて処理したい内容を記述すれば宜しいかと思います。

詳細は以下のサンプルをご参照ください。
(今回は改行コードを除去してクリップボードに設定しています。)

{curl 5.0,6.0,7.0,8.0 applet}
{curl-file-attributes character-encoding = “shift-jis”}

{import * from CURL.DESKTOP.CLIPBOARD}

{define-class public CustomCopyCommand {inherits CopyCommand}
  {constructor public {default context:SelectionContext}   
    {construct-super context}
  }
 
  {getter public open {context}:SelectionContext
    {return super.context asa SelectionContext}
  }
 
  {getter public open {enabled?}:bool
    {return true}
  }
   
  {method protected open {execute}:void 
    {if not self.enabled? then {return}}
    let constant context:SelectionContext = self.context
    let ret:StringBuf = {StringBuf}
    let str:String = {(self.context.selection asa TextSelection).get-text}
    let strs:StringArray = {str.split}
    {for str in strs do
        {ret.concat str}
    }
    {{Clipboard.get-system-clipboard}.set-string ret}
  }
}

{define-class CustomCommandTA {inherits TextArea}
  {constructor {default …}
    {construct-super
        value = null,
        prompt = null,
        max-chars = -1,
        data-model = null,
        ui-object = null,
        width = 200pt,
        height = 100pt,
        …}
  }
  {method public open {create-command name:String}:#Command
    {return
        {switch name
         case “copy” do {CustomCopyCommand {non-null self.selection-context}}
         else
            {super.create-command name}
        }
    }
  }
}

{define-class CustomCommandRTA {inherits RichTextArea}
  {constructor {default …}
    {construct-super
        value = null,
        prompt = null,
        max-chars = -1,
        data-model = null,
        ui-object = null,
        width = 200pt,
        height = 100pt,
        …}
  }
  {method public open {create-command name:String}:#Command
    {return
        {switch name
         case “copy” do {CustomCopyCommand {non-null self.selection-context}}
         else
            {super.create-command name}
        }
    }
  }
}

{let rta1:RichTextArea =  {RichTextArea width = 10cm, height = 4cm}}
{let rta2:RichTextArea =  {CustomCommandRTA width = 10cm, height = 4cm}}
{let ta1:TextArea =  {TextArea width = 10cm, height = 4cm}}
{let ta2:TextArea =  {CustomCommandTA width = 10cm, height = 4cm}}
{let ta3:TextArea = {TextArea width = 10cm, height = 5cm}}

{value
    {VBox
        “通常のRichTextArea”,
        rta1,
        “改行をコピーしないRichTextArea”,
        rta2,
        “通常のRichTextArea”,
        ta1,
        “改行をコピーしないRichTextArea”,
        ta2,
        “下のTextAreaに貼り付けて確認して下さい”,
        ta3
    }
}