PageRenderTime 48ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/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
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. * 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. openContextMenu(){
  11. // Get the caret's position
  12. caretOffset = textArea.getCaretPosition();
  13. caretPos = textArea.offsetToXY(caretOffset);
  14. // Open the context menu near the caret
  15. GUIUtilities.showPopupMenu(textArea.getRightClickPopup(),
  16. textArea,caretPos.x+10,caretPos.y+20);
  17. }
  18. openContextMenu();
  19. /*
  20. Macro index data (in DocBook format)
  21. <listitem>
  22. <para><filename>Open_Context_Menu.bsh</filename></para>
  23. <abstract><para>
  24. Opens the text area context menu just below and to
  25. the right of the caret.
  26. </para></abstract>
  27. </listitem>
  28. */