DynamicContextMenuService (jEdit API Documentation)
Date: 2015-02-03

org.gjt.sp.jedit.gui

## Class DynamicContextMenuService

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

-     public abstract class DynamicContextMenuService
      extends java.lang.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

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DynamicContextMenuService()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract javax.swing.JMenuItem[]` | `createMenu(JEditTextArea ta, java.awt.event.MouseEvent evt)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DynamicContextMenuService

          public DynamicContextMenuService()

  - ### Method Detail

    - #### createMenu

          public abstract javax.swing.JMenuItem[] createMenu(JEditTextArea ta,
                                           java.awt.event.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