Skip to content

Instantly share code, notes, and snippets.

@hborders
Created June 16, 2013 05:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hborders/5790870 to your computer and use it in GitHub Desktop.
Save hborders/5790870 to your computer and use it in GitHub Desktop.
From the SWT source. This just shows why some wacky API exists. I'm not sure this is the best solution for the problem, but the code definitely doesn't stand on its own. You could probably back it with a unit test, but I'd hate to have to delete these seemingly useless lines and run a testsuite just to find out what this did.
/*
* Plug-ins need an opportunity to set the org.eclipse.swt.browser.DefaultType
* system property before the first Browser is created. To facilitate this,
* reflection is used to reference non-existent class
* org.eclipse.swt.browser.BrowserInitializer the first time a Browser is created.
* A client wishing to use this hook can do so by creating a fragment of
* org.eclipse.swt that implements this class and sets the system property in its
* static initializer.
*/
try {
Class.forName ("org.eclipse.swt.browser.BrowserInitializer"); //$NON-NLS-1$
} catch (ClassNotFoundException e) {
/* no fragment is providing this class, which is the typical case */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment