logo
24.2
search
No matching documents found.
list
search
No matching documents found.
logo

SWT (Standard Widget Toolkit)

SWT configuration

Webswing offers a solution for running SWT applications in the web browser.

In general, SWT applications are configured the same way as regular Swing applications. You can use Admin Console or edit the webswing.config file manually. There are however a few specific settings that are necessary for running SWT applications in Webswing.

Basic SWT setup

In Admin Console, in Java section set Launcher Type to Swt. In Launcher Configuration put your SWT app main class and path to SWTSwing jar.

SWT Launcher Type

Note: the rest of the properties are documented in the Swing application setup page

Advanced SWT setup

If you want to configure an Eclipse RCP (Rich Client Platform) application you need configure some specific settings.

RCP setttings

Here are the most important parts of the setup explained.

vmArgs : "-Dosgi.parentClassloader=app"

Use the application classloader.

vmArgs : "-Dorg.eclipse.equinox.simpleconfigurator.configUrl=file:${webswing.rootDir}/apps/rcpmin/configuration/webswing-bundles.info"

This setting tells RCP where to look for new bundles.info file (webswing-bundles.info).

vmArgs : "-Dosgi.instance.area.default=${webswing.rootDir}/apps/rcpmin/workspace/${user}/"

This setting tells RCP where to look for workspace.

"mainClass" : "org.eclipse.equinox.launcher.Main"

The main class for RCP applications will always be org.eclipse.equinox.launcher.Main.

Create webswing-bundles.info

It is necessary to manually create a webswing-bundles.info file which is a copy of bundles.info. The difference is only in the commenting out these two lines:

org.eclipse.e4.ui.swt.win32

org.eclipse.swt.win32.win32.x86_64

Webswing-bundles.info

SWTSwing Library

Webswing uses SWTSwing from this github project. If you want to use your own SWTSwing library, configure SWTSwing Library Path in Launcher configuration.

New SWTSwing Path