products/sources/formale Sprachen/Isabelle/Tools/jEdit/dist/jEdit/macros/Clipboard image not shown  

Quellcode-Bibliothek

© Kompilation durch diese Firma

[Weder Korrektheit noch Funktionsfähigkeit der Software werden zugesichert.]

Datei: Copy_Lines.bsh   Sprache: Unknown

Spracherkennung für: .bsh vermutete Sprache: C {C[103] Abap[151] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

/*
* Copy_Lines.bsh - a BeanShell macro for jEdit
* which copies either the selected lines of text, or the current line 
* if no text is selected, to the clipboard.
*
* Copyright (C) 2003 Ollie Rutherfurd <[email protected]>
*
* $Id: Copy_Lines.bsh 22664 2013-01-09 13:16:00Z kpouer $
*/


copyLines()
{
 selections = textArea.getSelectedLines();
 
 if(selections.length == 0)
 {
  selections = new int [] {textArea.getCaretLine()};
 }
 start = textArea.getLineStartOffset(selections[0]);
 stop = textArea.getLineEndOffset(selections[selections.length-1]);
 int bufferLength = buffer.getLength();
 String text;
 if (stop > bufferLength)
 {
  text = textArea.getText(start,bufferLength - start) + '\n';
 }
 else
 {
  text = textArea.getText(start,stop-start);
 }
 java.awt.datatransfer.Transferable value = new java.awt.datatransfer.StringSelection(text);
 Registers.getRegister('$').setTransferable(value);
}

copyLines();

/*
Macro index data (in DocBook format)

<listitem>
<para><filename>Copy_Lines.bsh</filename>
<abstract><para>
If no text is selected, the current line is copied to 
the clipboard, otherwise otherwise, all lines that contain the selection 
are copied to the clipboard.
</para></abstract>
</listitem>

*/


[ Dauer der Verarbeitung: 0.155 Sekunden  ]