PageRenderTime 169ms CodeModel.GetById 166ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/jEdit/tags/jedit-4-3-pre5/macros/Misc/Display_Actions.bsh

#
Unknown | 76 lines | 68 code | 8 blank | 0 comment | 0 complexity | d85f1b4a895814c166a495ac85a5ecf8 MD5 | raw file
 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
25StringBuffer buf = new StringBuffer();
26buf.append("The jEdit action bar can be opened via the Utilities menu and is usually\n");
27buf.append("assigned to the C+ENTER keyboard shortcut.\n\n");
28
29actionSets = jEdit.getActionSets();
30Arrays.sort(actionSets,new MiscUtilities.StringICaseCompare());
31
32for(i = 0; i < actionSets.length; i++)
33{
34	ActionSet actionSet = actionSets[i];
35	if(actionSet.getActionCount() != 0)
36	{
37		buf.append("{{{ " + actionSet.getLabel() + "\n");
38
39		actions = actionSet.getActionNames();
40		Arrays.sort(actions,new MiscUtilities.StringICaseCompare());
41
42		for(j = 0; j < actions.length; j++)
43		{
44			String name = actions[j];
45			String label = jEdit.getProperty(actions[j] + ".label");
46			if(label == null)
47				label = "<no label>";
48			else
49				label = GUIUtilities.prettifyMenuLabel(label);
50			buf.append(name + " : " + label + "\n");
51		}
52		buf.append("}}}\n\n");
53	}
54}
55buffer = jEdit.newFile(view);
56buffer.insert(0,buf.toString());
57textArea.setCaretPosition(0);
58
59buffer.setStringProperty("folding","explicit");
60buffer.setIntegerProperty("collapseFolds",1);
61buffer.propertiesChanged();
62
63/*
64Macro index data (in DocBook format)
65
66<listitem>
67	<para><filename>Display_Actions.bsh</filename></para>
68	<abstract><para>
69		Displays a list of all the actions known to jEdit categorised by
70		their action set.
71	</para></abstract>
72	<para>
73		This macro can be a useful reference if you want to use the jEdit 4.2 action bar.
74	</para>
75</listitem>
76*/