Package ghidra.framework.options

# Class ActionTrigger

java.lang.Object
ghidra.framework.options.ActionTrigger

public class ActionTrigger extends Object
Represents a way to trigger an action in the system. A trigger is based on a key stroke, a mouse binding or both.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ActionTrigger(MouseBinding mouseBinding)`
  Creates an action trigger with the given mouse binding.
  `ActionTrigger(KeyStroke keyStroke)`
  Creates an action trigger with the given key stroke.
  `ActionTrigger(KeyStroke keyStroke, MouseBinding mouseBinding)`
  A convenience constructor for creating an action trigger with either or both values set.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static ActionTrigger`
  `create(SaveState saveState)`
  Creates a new action trigger by reading data from the given save state.
  `boolean`
  `equals(Object obj)`
  `static ActionTrigger`
  `getActionTrigger(String string)`
  Creates a new action trigger from the given string.
  `KeyStroke`
  `getKeyStroke()`
  `MouseBinding`
  `getMouseBinding()`
  `int`
  `hashCode()`
  `String`
  `toString()`
  `void`
  `writeState(SaveState saveState)`
  Writes this action trigger's data into the given save state.

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

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

- ## Constructor Details

  - ### ActionTrigger

    public ActionTrigger(KeyStroke keyStroke)
    Creates an action trigger with the given key stroke.
    Parameters:
      `keyStroke` - the key stroke

  - ### ActionTrigger

    public ActionTrigger(MouseBinding mouseBinding)
    Creates an action trigger with the given mouse binding.
    Parameters:
      `mouseBinding` - the mouse binding

  - ### ActionTrigger

    public ActionTrigger(KeyStroke keyStroke, MouseBinding mouseBinding)
    A convenience constructor for creating an action trigger with either or both values set. At least one of the values must be non-null.
    Parameters:
      `keyStroke` - the key stroke; may be null
      `mouseBinding` - the mouse binding; may be null

- ## Method Details

  - ### getKeyStroke

    public KeyStroke getKeyStroke()

  - ### getMouseBinding

    public MouseBinding getMouseBinding()

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### getActionTrigger

    public static ActionTrigger getActionTrigger(String string)
    Creates a new action trigger from the given string. The string is expected to be the result of calling `toString()` on an instance of this class.
    Parameters:
      `string` - the string to parse.
    Returns:
      the new instance or null of the string is invalid.

  - ### writeState

    public void writeState(SaveState saveState)
    Writes this action trigger's data into the given save state.
    Parameters:
      `saveState` - the save state

  - ### create

    public static ActionTrigger create(SaveState saveState)
    Creates a new action trigger by reading data from the given save state.
    Parameters:
      `saveState` - the save state
    Returns:
      the new action trigger

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### equals

    public boolean equals(Object obj)
    Overrides:
      `equals` in class `Object`