Class JxBrowserUtil

java.lang.Object
com.inductiveautomation.ignition.client.util.JxBrowserUtil

public final class JxBrowserUtil extends Object
This class should only be called if JX Browser libs are on the class path.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static 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 Chromium
    static 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 an Engine instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    static 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 an EngineOptions 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)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • CHROMIUM_DIR

      public static final String 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

      public static final String DEBUG_PORT
      System flag used to declare alternative debug port exposed by Chromium
      See Also:
    • DEFAULT_DEBUG_PORT

      public static final int DEFAULT_DEBUG_PORT
      Default port exposed by chromium for the purposes of attaching chromium dev-tools. Overridden by providing the specifying the DEBUG_PORT as a System (jvm) flag (e.g., ignition.conf jvm params).
      See Also:
    • JXBROWSER_LICENSE

      public static final String JXBROWSER_LICENSE
      Override the JxBrowser license used to create an Engine 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

      public static final String DEFAULT_JXBROWSER_DIR
      Default name of the folder containing chromium's runtime binaries/assets.
      See Also:
    • JX_BROWSER_VERSION

      public static final String 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

      public static Optional<com.teamdev.jxbrowser.engine.Engine> getOrCreateEngine(@Nonnull Path resourceDir, @Nonnull com.teamdev.jxbrowser.engine.EngineOptions options)
    • 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 zoom
      previousZoom - 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)
    • initNavLifecycleObserverLogging

      public static void initNavLifecycleObserverLogging(@Nonnull com.teamdev.jxbrowser.browser.Browser browser, @Nullable JTextField urlField)
    • prettyPrintEngineOptions

      public static String prettyPrintEngineOptions(@Nullable com.teamdev.jxbrowser.engine.EngineOptions options)
      Simple utility method that takes an EngineOptions 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.