class CommentUtil {

    private static void blockUncomment(JTextArea scriptPanel) {
        // Recover the index of the start of the selection.
        final int startOffset = scriptPanel.getSelectionStart();
        final int endOffset = scriptPanel.getSelectionEnd();
        // Delete the comment characters.
        scriptPanel.replaceRange("", endOffset - BLOCK_COMMENT_END.length(), endOffset);
        scriptPanel.replaceRange("", startOffset, startOffset + BLOCK_COMMENT_START.length());
        // Select the uncommented selection.
        scriptPanel.setSelectionStart(startOffset);
        scriptPanel.setSelectionEnd(endOffset - BLOCK_COMMENT_START.length()
                - BLOCK_COMMENT_END.length());
    }

}