Interface ExtensionAction

All Superinterfaces:
Observable<ExtensionActionEvent>

public interface ExtensionAction extends Observable<ExtensionActionEvent>
An extension action.

The extension action represents an icon in the toolbar near the address bar in Chromium. JxBrowser does not display Chromium toolbar, but you can access the extension action icon, tooltip, badge, and other properties to display a clickable extension icon in your application. You can also interact with the extension action programmatically by simulating a click on it.

The extension action properties can change over time. To receive notifications about the changes, subscribe to receive the ExtensionActionUpdated events.

Since:
8.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the badge that is layered over the extension action icon.
    void
    Simulates a click on the extension action icon.
    Returns the extension that owns this action.
    Returns the icon of this extension action.
    boolean
    Returns true when this action is enabled.
    Returns the tooltip of this extension action.
    Returns the type of this extension action.

    Methods inherited from interface com.teamdev.jxbrowser.event.Observable

    on
  • Method Details

    • extension

      Extension extension()
      Returns the extension that owns this action.
    • icon

      Bitmap icon()
      Returns the icon of this extension action.
      Throws:
      ObjectClosedException - when the extension is uninstalled or the associated browser is closed
    • tooltip

      String tooltip()
      Returns the tooltip of this extension action.
      Throws:
      ObjectClosedException - when the extension is uninstalled or the associated browser is closed
    • badge

      String badge()
      Returns the badge that is layered over the extension action icon.
      Throws:
      ObjectClosedException - when the extension is uninstalled or the associated browser is closed
    • type

      Returns the type of this extension action.
      Throws:
      ObjectClosedException - when the extension is uninstalled or the associated browser is closed
    • isEnabled

      boolean isEnabled()
      Returns true when this action is enabled.
      Throws:
      ObjectClosedException - when the extension is uninstalled or the associated browser is closed
    • click

      void click()
      Simulates a click on the extension action icon.

      If the extension action has a popup configured, the OpenExtensionActionPopupCallback is invoked to allow you to embed the popup into a window. Otherwise, if the action does not have a popup, the action.onClicked event is dispatched to the action.

      When an extension action popup for a browser is already opened, this method will not invoke OpenExtensionActionPopupCallback. However, the callback would still be invoked for other extensions. To close the extension action popup and start receiving the callback again, close the extension action popup's browser instance.

      Throws:
      ObjectClosedException - when the extension is uninstalled or the associated browser is closed
      IllegalStateException - when the extension action is disabled