PageRenderTime 44ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/jEdit/tags/jedit-4-2-pre14/macros/Misc/Display_Actions.bsh

#
Unknown | 76 lines | 68 code | 8 blank | 0 comment | 0 complexity | d85f1b4a895814c166a495ac85a5ecf8 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. * Display_Actions.bsh - Displays a list of all the actions known to jEdit
  3. * categorised by ActionSet.
  4. *
  5. * Copyright (C) 2002 Lee Turner (lee@leeturner.org)
  6. * Version 1.0
  7. *
  8. * :tabSize=4:indentSize=4:noTabs=false:folding=explicit:collapseFolds=1:
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License
  12. * as published by the Free Software Foundation; either version 2
  13. * of the License, or any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  23. */
  24. StringBuffer buf = new StringBuffer();
  25. buf.append("The jEdit action bar can be opened via the Utilities menu and is usually\n");
  26. buf.append("assigned to the C+ENTER keyboard shortcut.\n\n");
  27. actionSets = jEdit.getActionSets();
  28. Arrays.sort(actionSets,new MiscUtilities.StringICaseCompare());
  29. for(i = 0; i < actionSets.length; i++)
  30. {
  31. ActionSet actionSet = actionSets[i];
  32. if(actionSet.getActionCount() != 0)
  33. {
  34. buf.append("{{{ " + actionSet.getLabel() + "\n");
  35. actions = actionSet.getActionNames();
  36. Arrays.sort(actions,new MiscUtilities.StringICaseCompare());
  37. for(j = 0; j < actions.length; j++)
  38. {
  39. String name = actions[j];
  40. String label = jEdit.getProperty(actions[j] + ".label");
  41. if(label == null)
  42. label = "<no label>";
  43. else
  44. label = GUIUtilities.prettifyMenuLabel(label);
  45. buf.append(name + " : " + label + "\n");
  46. }
  47. buf.append("}}}\n\n");
  48. }
  49. }
  50. buffer = jEdit.newFile(view);
  51. buffer.insert(0,buf.toString());
  52. textArea.setCaretPosition(0);
  53. buffer.setStringProperty("folding","explicit");
  54. buffer.setIntegerProperty("collapseFolds",1);
  55. buffer.propertiesChanged();
  56. /*
  57. Macro index data (in DocBook format)
  58. <listitem>
  59. <para><filename>Display_Actions.bsh</filename></para>
  60. <abstract><para>
  61. Displays a list of all the actions known to jEdit categorised by
  62. their action set.
  63. </para></abstract>
  64. <para>
  65. This macro can be a useful reference if you want to use the jEdit 4.2 action bar.
  66. </para>
  67. </listitem>
  68. */