Interface Target.ActionEntry

Enclosing interface:
Target

public static interface Target.ActionEntry
A description of a UI action provided by this target.

In most cases, this will generate a menu entry or a toolbar button, but in some cases, it's just invoked implicitly. Often, the two suppliers are implemented using lambda functions, and those functions will keep whatever some means of querying UI and/or target context in their closures.

  • Method Summary

    Modifier and Type
    Method
    Description
    Get the text providing more details, usually displayed in a tool tip
    Get the text to display on UI actions associated with this entry
    default Object
    get(boolean prompt)
    Invoke the action synchronously, getting its result
    Check if this action's name is built in
    Get the icon to display in menus and dialogs
    invokeAsync(boolean prompt)
    Invoke the action asynchronously, prompting if desired
    invokeAsyncWithoutTimeout(boolean prompt)
    Invoke the action asynchronously, prompting if desired.
    boolean
    Check if this action is currently enabled
    Get the name of a common debugger command this action implements
    boolean
    Check whether invoking the action requires further user interaction
    default void
    run(boolean prompt)
    Invoke the action synchronously
    long
    Get a relative score of specificity.
  • Method Details

    • display

      String display()
      Get the text to display on UI actions associated with this entry
      Returns:
      the display
    • name

      ActionName name()
      Get the name of a common debugger command this action implements
      Returns:
      the name
    • icon

      Icon icon()
      Get the icon to display in menus and dialogs
      Returns:
      the icon
    • details

      String details()
      Get the text providing more details, usually displayed in a tool tip
      Returns:
      the details
    • requiresPrompt

      boolean requiresPrompt()
      Check whether invoking the action requires further user interaction
      Returns:
      true if prompting is required
    • specificity

      long specificity()
      Get a relative score of specificity.

      These are only meaningful when compared among entries returned in the same collection.

      Returns:
      the specificity
    • invokeAsyncWithoutTimeout

      CompletableFuture<?> invokeAsyncWithoutTimeout(boolean prompt)
      Invoke the action asynchronously, prompting if desired.

      The implementation is not required to provide a timeout; however, downstream components may.

      Parameters:
      prompt - whether or not to prompt the user for arguments
      Returns:
      the future result, often Void
    • isEnabled

      boolean isEnabled()
      Check if this action is currently enabled
      Returns:
      true if enabled
    • invokeAsync

      default CompletableFuture<?> invokeAsync(boolean prompt)
      Invoke the action asynchronously, prompting if desired

      Note this will impose a timeout of 10000L milliseconds.

      Parameters:
      prompt - whether or not to prompt the user for arguments
      Returns:
      the future result, often Void
    • run

      default void run(boolean prompt)
      Invoke the action synchronously

      To avoid blocking the Swing thread on a remote socket, this method cannot be called on the Swing thread.

      Parameters:
      prompt - whether or not to prompt the user for arguments
    • get

      default Object get(boolean prompt)
      Invoke the action synchronously, getting its result
      Parameters:
      prompt - whether or not to prompt the user for arguments
      Returns:
      the resulting value, if applicable
    • getShow

      default ActionName.Show getShow()
      Check if this action's name is built in
      Returns:
      true if built in.