PageRenderTime 51ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/jEdit/tags/jedit-4-2-pre14/macros/Files/Close_All_Except_Active.bsh

#
Unknown | 57 lines | 49 code | 8 blank | 0 comment | 0 complexity | 1494d34598a1b49dae30f22bd96de040 MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
  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. void closeBuffersExceptActive()
  28. {
  29. buffers = jEdit.getBuffers();
  30. for(i = 0; i < buffers.length; ++i)
  31. {
  32. if(buffers[i] != buffer)
  33. jEdit.closeBuffer(view, buffers[i]);
  34. }
  35. }
  36. closeBuffersExceptActive();
  37. /*
  38. Macro index data (in DocBook format)
  39. <listitem>
  40. <para><filename>Close_Except_Active.bsh</filename></para>
  41. <abstract><para>
  42. Closes all files except the current buffer.
  43. </para></abstract>
  44. <para>
  45. Prompts the user to save any buffer containing unsaved changes.
  46. </para>
  47. </listitem>
  48. */
  49. // end Close_Except_Active.bsh