Uploaded image for project: 'Java Mission Control'
  1. Java Mission Control
  2. JMC-8388

Set SWT.EDGE when creating a swt browser in Windows

XMLWordPrintable

      Comment: https://github.com/openjdk/jmc/pull/639#issuecomment-2821525234

      When creating the Browser object for web-based views in the JMC UI, there is an optional parameter to set the "style" in the Browser constructor. If not set, the Browser performs a series of checks to determine what Browser to create based on the OS. For Windows, if Edge hasn't been set as the default browser via property settings then in the if-statement the branch to set IE resolves before the branch for Edge (https://github.com/eclipse-platform/eclipse.platform.swt/blob/master/bundles/org.eclipse.swt/Eclipse%20SWT%20Browser/common/org/eclipse/swt/browser/Browser.java#L185).

      There are several ways Edge could be forced, but maybe simply checking if the OS is Windows and passing "SWT.EDGE" into the Browser constructor would be the easiest way to force this. I tried to set Edge as the default browser using property settings in a recent Windows build of JMC and I couldn't get it to actually use Edge, but editing the run configuration and launching through Eclipse did the trick.

            Unassigned Unassigned
            aptmac Alex Macdonald
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: