Class JxBrowserUtil
java.lang.Object
com.inductiveautomation.ignition.client.util.JxBrowserUtil
This class should only be called if JX Browser libs are on the class path.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
System flag used to specify alternative location for the binaries/assets used by the JxBrowser chromium engine.static final String
System flag used to declare alternative debug port exposed by Chromiumstatic final int
Default port exposed by chromium for the purposes of attaching chromium dev-tools.static final String
Default name of the folder containing chromium's runtime binaries/assets.static final String
static final String
Override the JxBrowser license used to create anEngine
instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<com.teamdev.jxbrowser.engine.Engine>
getOrCreateEngine
(LaunchContext launchContext, com.teamdev.jxbrowser.engine.RenderingMode renderingMode, String jxbLicense) static Optional<com.teamdev.jxbrowser.engine.Engine>
getOrCreateEngine
(LaunchContext launchContext, com.teamdev.jxbrowser.engine.RenderingMode renderingMode, String jxbLicense, String userDataDir) static Optional<com.teamdev.jxbrowser.engine.Engine>
getOrCreateEngine
(Path resourceDir, com.teamdev.jxbrowser.engine.EngineOptions options) static boolean
hasModifiers
(com.teamdev.jxbrowser.ui.KeyModifiers modifiers) static void
initNavLifecycleObserverLogging
(com.teamdev.jxbrowser.browser.Browser browser, JTextField urlField) static void
neverAskToSavePasswords
(com.teamdev.jxbrowser.browser.Browser browser) static String
prettyPrintEngineOptions
(com.teamdev.jxbrowser.engine.EngineOptions options) Simple utility method that takes anEngineOptions
object and returns a human readable string showing the options that are configured.static void
shutdown
(com.teamdev.jxbrowser.engine.EngineOptions options) Shuts down the engine that was created using the specified chromium directory.static com.teamdev.jxbrowser.net.callback.VerifyCertificateCallback.Response
verifyCertificate
(com.teamdev.jxbrowser.net.callback.VerifyCertificateCallback.Params params) static int
zoomPercentFromMouseWheelEvent
(com.teamdev.jxbrowser.ui.event.MouseWheel mouseEvent, com.teamdev.jxbrowser.zoom.ZoomLevel previousZoom)
-
Field Details
-
CHROMIUM_DIR
System flag used to specify alternative location for the binaries/assets used by the JxBrowser chromium engine. Defaults to<designer cache directory>/.ignition
.- See Also:
-
DEBUG_PORT
System flag used to declare alternative debug port exposed by Chromium- See Also:
-
DEFAULT_DEBUG_PORT
public static final int DEFAULT_DEBUG_PORTDefault port exposed by chromium for the purposes of attaching chromium dev-tools. Overridden by providing the specifying theDEBUG_PORT
as a System (jvm) flag (e.g., ignition.conf jvm params).- See Also:
-
JXBROWSER_LICENSE
Override the JxBrowser license used to create anEngine
instance. Not intended for public use due to restrictions requiring a license specific to Ignition, but may be useful in updating the license on systems which are unable to otherwise update to a newer version of Ignition, yet need to apply a more recent license.- See Also:
-
DEFAULT_JXBROWSER_DIR
Default name of the folder containing chromium's runtime binaries/assets.- See Also:
-
JX_BROWSER_VERSION
-
-
Method Details
-
verifyCertificate
public static com.teamdev.jxbrowser.net.callback.VerifyCertificateCallback.Response verifyCertificate(com.teamdev.jxbrowser.net.callback.VerifyCertificateCallback.Params params) -
shutdown
public static void shutdown(@Nullable com.teamdev.jxbrowser.engine.EngineOptions options) Shuts down the engine that was created using the specified chromium directory.- Parameters:
options
- the engine options for the engine being closed (may get by calling engine.options())
-
getOrCreateEngine
-
hasModifiers
public static boolean hasModifiers(com.teamdev.jxbrowser.ui.KeyModifiers modifiers) -
getOrCreateEngine
public static Optional<com.teamdev.jxbrowser.engine.Engine> getOrCreateEngine(@Nonnull LaunchContext launchContext, @Nonnull com.teamdev.jxbrowser.engine.RenderingMode renderingMode, @Nonnull String jxbLicense) -
getOrCreateEngine
public static Optional<com.teamdev.jxbrowser.engine.Engine> getOrCreateEngine(@Nonnull LaunchContext launchContext, @Nonnull com.teamdev.jxbrowser.engine.RenderingMode renderingMode, @Nonnull String jxbLicense, @Nullable String userDataDir) -
zoomPercentFromMouseWheelEvent
public static int zoomPercentFromMouseWheelEvent(com.teamdev.jxbrowser.ui.event.MouseWheel mouseEvent, com.teamdev.jxbrowser.zoom.ZoomLevel previousZoom) - Parameters:
mouseEvent
- the raw mouse event that triggered the change in zoompreviousZoom
- the level that is the basis of the new zoom- Returns:
- integer representing the percent of zoom for the new value
-
neverAskToSavePasswords
public static void neverAskToSavePasswords(@Nonnull com.teamdev.jxbrowser.browser.Browser browser) -
prettyPrintEngineOptions
public static String prettyPrintEngineOptions(@Nullable com.teamdev.jxbrowser.engine.EngineOptions options) Simple utility method that takes anEngineOptions
object and returns a human readable string showing the options that are configured.- Returns:
- human readable string of the options, or "null" of the options object was null.
-