/* * ReadOnly_Buffer.bsh - a BeanShell macro script for the * jEdit text editor - sets current buffer to read only without changing * file status on hard disc * Copyright (C) 2004 Aleksandar Marinkovic * email: codi@bsd.org.yu * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id: ReadOnly_Buffer.bsh,v 1.0 05/June/2004 22:40:35 codi Exp $ * * requires JDK 1.4, jEdit4.2 * * Notes on use: * * * This macro will set current buffer to read-only mode without changing * file flag on hard disc so another user can access that file in * read-write mode. * Another call will unset buffer read-only flag. * * Checked for jEdit 4.0 API * */ void ro_Buffer(view) { buffer = view.getBuffer(); ro = buffer.isReadOnly(); buffer.setReadOnly(!ro); } ro_Buffer(view); buffer.reload(view); /* Macro index data (in DocBook format) Open_Path.bsh Opens the file supplied by the user in an input dialog. */ // end ReadOnly_Buffer.bsh