/jEdit/tags/jedit-3-2-2/macros/Misc/List_Plugin_Internal_Names.bsh

# · Unknown · 52 lines · 47 code · 5 blank · 0 comment · 0 complexity · 53b33926ec6ee6ff31fca92340027e44 MD5 · raw file

  1. /*
  2. * List_Plugin_Internal_Names.bsh - a BeanShell macro script for the
  3. * jEdit text editor - lists installed plugins by internal working name
  4. * Copyright (C) 2001 John Gellene
  5. * jgellene@nyc.rr.com
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * as published by the Free Software Foundation; either version 2
  10. * of the License, or any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with the jEdit program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  20. *
  21. * $Id: List_Plugin_Internal_Names.bsh 3791 2001-09-02 05:36:59Z spestov $
  22. */
  23. void listPluginNames()
  24. {
  25. EditPlugin[] ep =jEdit.getPlugins();
  26. if(ep == null)
  27. {
  28. Macros.error(view, "Plugin list not found");
  29. return;
  30. }
  31. jEdit.newFile(view);
  32. Vector v = new Vector(ep.length);
  33. for(int i = 0; i < ep.length; ++i)
  34. {
  35. v.addElement(ep[i].getClassName());
  36. }
  37. MiscUtilities.quicksort(v, new MiscUtilities.StringICaseCompare());
  38. sb = new StringBuffer(ep.length * 16);
  39. for(i = 0; i < v.size(); ++i)
  40. {
  41. sb.append((String)v.elementAt(i));
  42. sb.append('\n');
  43. }
  44. textArea.setSelectedText(sb.toString());
  45. }
  46. listPluginNames();
  47. // end of List_Plugin_Internal_Names.bsh