PageRenderTime 38ms CodeModel.GetById 36ms app.highlight 1ms RepoModel.GetById 0ms app.codeStats 1ms

/jEdit/tags/jedit-4-2-pre14/macros/Interface/Open_Context_Menu.bsh

#
Unknown | 34 lines | 28 code | 6 blank | 0 comment | 0 complexity | b1c6d694b02762cbbc872d5da05b3045 MD5 | raw file
 1/*
 2* Open_Context_Menu.bsh - a BeanShell macro script for
 3* the jEdit text editor - Opens the editor context menu
 4* just below and to the right of the cursor.
 5*
 6* Copyright (C) 2003 Nitsan Vardi
 7*
 8* $Id: Open_Context_Menu.bsh 4937 2003-12-22 04:14:55Z spestov $
 9*/
10
11openContextMenu(){
12	// Get the caret's position
13	caretOffset = textArea.getCaretPosition();
14	caretPos = textArea.offsetToXY(caretOffset);
15	// Open the context menu near the caret
16	GUIUtilities.showPopupMenu(textArea.getRightClickPopup(),
17		textArea,caretPos.x+10,caretPos.y+20);
18}
19
20openContextMenu();
21
22/*
23	Macro index data (in DocBook format)
24
25<listitem>
26    <para><filename>Open_Context_Menu.bsh</filename></para>
27    <abstract><para>
28        Opens the text area context menu just below and to 
29		the right of the caret.
30    </para></abstract>
31</listitem>
32
33*/
34