/*
 * Reverse_Selection.bsh - a BeanShell macro for jEdit
 * which reverses the content of the selection 
 *
 * Copyright (C) 2013 Thomas Meyer
 *
 */

reverseSelection()
{
	selectionCount = textArea.getSelectionCount();
	if(selectionCount > 0)
	{
		selection = textArea.getSelection(0);
		text = textArea.getSelectedText(selection);
		revText = new org.gjt.sp.util.ReverseCharSequence(text);
		textArea.setSelectedText(selection, revText.toString());
	}
}

reverseSelection();

/*
	Macro index data (in DocBook format)

<listitem>
	<para><filename>Reverse_Selection.bsh</filename>
	<abstract><para>
		Reversere the content of the first selection
	</para></abstract>
</listitem>

*/
