PageRenderTime 17ms CodeModel.GetById 14ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/jEdit/tags/jedit-4-0-pre5/macros/Files/Close_All_Except_Active.bsh

#
Unknown | 57 lines | 49 code | 8 blank | 0 comment | 0 complexity | 1494d34598a1b49dae30f22bd96de040 MD5 | raw file
 1/*
 2 * Close_All_Except_Active.bsh - a BeanShell macro script for the
 3 * jEdit text editor - Closes all except the current active buffer
 4 * Copyright (C) 2001 John Gellene
 5 * jgellene@nyc.rr.com
 6 * http://community.jedit.org
 7 *
 8 * This program is free software; you can redistribute it and/or
 9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
21 *
22 * $Id: Close_All_Except_Active.bsh 3871 2001-11-06 17:15:01Z jgellene $
23 *
24 * Checked for jEdit 4.0 API
25 *
26 */
27
28void closeBuffersExceptActive()
29{
30	buffers = jEdit.getBuffers();
31	for(i = 0; i < buffers.length; ++i)
32	{
33		if(buffers[i] != buffer)
34			jEdit.closeBuffer(view, buffers[i]);
35	}
36}
37
38closeBuffersExceptActive();
39
40/*
41	Macro index data (in DocBook format)
42
43<listitem>
44    <para><filename>Close_Except_Active.bsh</filename></para>
45    <abstract><para>
46        Closes all files except the current buffer.
47    </para></abstract>
48    <para>
49        Prompts the user to save any buffer containing unsaved changes.
50    </para>
51</listitem>
52
53*/
54
55
56// end Close_Except_Active.bsh
57