PageRenderTime 83ms CodeModel.GetById 80ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/jEdit/tags/jedit-4-0-pre5/macros/Java/Get_Class_Name.bsh

#
Unknown | 53 lines | 44 code | 9 blank | 0 comment | 0 complexity | 933adb938fe57a17f85888b47756dc1c MD5 | raw file
 1/*
 2 * Get_Class_Name.bsh - a BeanShell macro script for the
 3 * jEdit text editor -  gets class name from buffer name
 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 the jEdit program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
21 *
22 * $Id: Get_Class_Name.bsh 3872 2001-11-06 17:28:22Z jgellene $
23 *
24 * Checked for jEdit 4.0 API
25 *
26 */
27
28
29void getClassName()
30{
31	name = buffer.getName();
32	index = name.lastIndexOf('.');
33	textArea.setSelectedText( index != -1 ?
34		name.substring(0, index) : name);
35}
36
37getClassName();
38
39/*
40	Macro index data (in DocBook format)
41
42<listitem>
43    <para><filename>Get_Class_Name.bsh</filename></para>
44    <abstract><para>
45        Inserts a Java class name based upon the buffer's file name.
46    </para></abstract>
47</listitem>
48
49*/
50
51
52// end Get_Class_Name.bsh
53