org.gjt.sp.jedit

## Class EditAction

- java.lang.Object
- - org.gjt.sp.jedit.JEditAbstractEditAction<View>
  - - org.gjt.sp.jedit.EditAction

- Direct Known Subclasses:
    BeanShellAction, Macros.Macro

      public abstract class EditAction
      extends JEditAbstractEditAction<View>

  An action that can be bound to a menu item, tool bar button or keystroke.
  See Also:
    `jEdit.getAction(String)`, `jEdit.getActionNames()`, `ActionSet`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `EditAction.Wrapper` 'Wrap' EditActions in this class to turn them into AWT ActionListeners, that can be attached to buttons, menu items, etc.

  - ### Field Summary

    - ### Fields inherited from class org.gjt.sp.jedit.JEditAbstractEditAction

      `args, name`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EditAction(java.lang.String name)` Creates a new edit action with the specified name.
    `EditAction(java.lang.String name, java.lang.Object[] newArgs)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getCode()`
    `java.lang.String` | `getLabel()`
    `java.lang.String` | `getMouseOverText()`
    `abstract void` | `invoke(View view)` Invokes the action.
    `boolean` | `isSelected(java.awt.Component comp)`
    `boolean` | `isToggle()`
    `boolean` | `noRecord()`
    `boolean` | `noRememberLast()`
    `boolean` | `noRepeat()`

    - ### Methods inherited from class org.gjt.sp.jedit.JEditAbstractEditAction

      `getName, invoke, setName, toString`

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

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

- - ### Constructor Detail

    - #### EditAction

          public EditAction(java.lang.String name)

      Creates a new edit action with the specified name.
      Parameters:
        `name` - The action name

    - #### EditAction

          public EditAction(java.lang.String name,
                            java.lang.Object[] newArgs)

  - ### Method Detail

    - #### getLabel

          public java.lang.String getLabel()

      Returns:
        the action's label. This returns the value of the property named by `JEditAbstractEditAction.getName()` suffixed with `.label`.

    - #### getMouseOverText

          public final java.lang.String getMouseOverText()

      Returns:
        the action's mouse over message. This returns the value of the property named by `JEditAbstractEditAction.getName()` suffixed with `.mouse-over`.

    - #### invoke

          public abstract void invoke(View view)

      Invokes the action. This is an implementation of the Command pattern, and concrete actions should override this.
      Specified by:
        `invoke` in class `JEditAbstractEditAction<View>`
      Parameters:
        `view` - The view
      Since:
        jEdit 2.7pre2 abstract since jEdit 4.3pre7

    - #### isToggle

          public final boolean isToggle()

      Returns:
        if this edit action should be displayed as a check box in menus. This returns the value of the property named by `JEditAbstractEditAction.getName()` suffixed with `.toggle`.
      Since:
        jEdit 2.2pre4

    - #### isSelected

          public boolean isSelected(java.awt.Component comp)

      Parameters:
        `comp` - The component
      Returns:
        If this edit action is a toggle, returns if it is selected or not.
      Since:
        jEdit 4.2pre1

    - #### noRepeat

          public boolean noRepeat()

      Returns:
        if this edit action should not be repeated. Returns false by default.
      Since:
        jEdit 2.7pre2

    - #### noRecord

          public boolean noRecord()

      Returns:
        if this edit action should not be recorded. Returns false by default.
      Since:
        jEdit 2.7pre2

    - #### noRememberLast

          public boolean noRememberLast()

      Returns:
        if this edit action should not be remembered as the most recently invoked action.
      Since:
        jEdit 4.2pre1

    - #### getCode

          public java.lang.String getCode()

      Returns:
        the BeanShell code that will replay this action. BeanShellAction.getCode() returns something more interesting for Actions that were loaded from the actions.xml file. You do not need to override this method if your action name is unique, this EditAction was added to an ActionSet and that to an ActionContext of jEdit. concrete since jEdit 4.3pre7
      Since:
        jEdit 2.7pre2