Package limn.scene

Enum Class EditCommand

All Implemented Interfaces:
Serializable, Comparable<EditCommand>, Constable

public enum EditCommand extends Enum<EditCommand>
One of the six commands of an Edit menu, done by whichever widget has the keyboard.

A widget says which of them it can do now and does them, through Widget.onCanEdit(limn.scene.EditCommand) and Widget.onEdit(limn.scene.EditCommand); Scene.canEdit(limn.scene.EditCommand) and Scene.edit(limn.scene.EditCommand) ask the focused widget and then its ancestors. A menu's item made for one, MenuItem.of(MenuItem.Role.COPY), is enabled and acts by them, so a Copy in a menu bar, in a tool bar and on the keyboard are the same copy.

A 1.x minor release may add constants to this enum: a switch over it needs a default branch.

  • Enum Constant Details

    • UNDO

      public static final EditCommand UNDO
      Takes back the last edit.
    • REDO

      public static final EditCommand REDO
      Does again the edit last taken back.
    • CUT

      public static final EditCommand CUT
      Moves the selection to the clipboard.
    • COPY

      public static final EditCommand COPY
      Copies the selection to the clipboard.
    • PASTE

      public static final EditCommand PASTE
      Puts the clipboard's content in, over the selection.
    • SELECT_ALL

      public static final EditCommand SELECT_ALL
      Selects everything the widget holds.
  • Method Details

    • values

      public static EditCommand[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static EditCommand valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null