Module jEdit

Class DynamicContextMenuService

java.lang.Object
org.gjt.sp.jedit.gui.DynamicContextMenuService

public abstract class DynamicContextMenuService extends Object

A service that can be offered by plugins when a text area context menu item needs to be offered that is sensitive to the state of the TextArea it was requested * from.

Note: this service should only be used by certain plugins that need context information at the time that the context menu is requested. For all other actions, it is already possible for users to add menu items to the context menu, so please do not use this service from Plugins to add non-dynamic actions to the context menu.
Since:
jEdit 4.3pre15
Author:
ezust
  • Constructor Details

    • DynamicContextMenuService

      public DynamicContextMenuService()
  • Method Details

    • createMenu

      public abstract JMenuItem[] createMenu(JEditTextArea ta, MouseEvent evt)
      Parameters:
      ta - the TextArea where the context menu was requested. Use this to determine the location of the caret, or the edit mode of the buffer, etc.
      evt - a mouseEvent that triggered this menu request, or null
      Returns:
      an array of menu items or null if there are no appropriate actions to be added at this time