Interface ExtensionAction
- All Superinterfaces:
Observable<ExtensionActionEvent>
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 TypeMethodDescriptionbadge()Returns the badge that is layered over the extension action icon.voidclick()Simulates a click on the extension action icon.Returns the extension that owns this action.icon()Returns the icon of this extension action.booleanReturns true when this action is enabled.tooltip()Returns the tooltip of this extension action.type()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
ExtensionActionType 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
OpenExtensionActionPopupCallbackis invoked to allow you to embed the popup into a window. Otherwise, if the action does not have a popup, theaction.onClickedevent 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'sbrowserinstance.- Throws:
ObjectClosedException- when the extension is uninstalled or the associated browser is closedIllegalStateException- when the extension action is disabled
-