PageRenderTime 143ms CodeModel.GetById 136ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 1ms

/jEdit/tags/jedit-4-1-pre5/macros/Files/Open_Selection.bsh

#
Unknown | 51 lines | 43 code | 8 blank | 0 comment | 0 complexity | 32865850f9b6961e1707edf219306506 MD5 | raw file
 1/*
 2 * Open_Selection.bsh - a BeanShell macro script for the
 3 * jEdit text editor - opens file named by selected text
 4 * Copyright (C) 2001 Slava Pestov
 5 *
 6 * This program is free software; you can redistribute it and/or
 7 * modify it under the terms of the GNU General Public License
 8 * as published by the Free Software Foundation; either version 2
 9 * of the License, or any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with the jEdit program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19 *
20 * $Id: Open_Selection.bsh 3871 2001-11-06 17:15:01Z jgellene $
21 *
22 * Checked for jEdit 4.0 API
23 *
24 */
25
26void openSelection()
27{
28	String path = textArea.getSelectedText();
29	if(path == null)
30		view.getToolkit().beep();
31	else
32		jEdit.openFile(view,path);
33}
34
35openSelection();
36
37/*
38	Macro index data (in DocBook format)
39
40<listitem>
41    <para><filename>Open_Selection.bsh</filename></para>
42    <abstract><para>
43        Opens the file named by the current buffer's selected text.
44    </para></abstract>
45</listitem>
46
47*/
48
49
50// end Open_Selection.bsh
51