Views
5 months ago

tornadofx-guide

OSGi

OSGi tabPane.addViewsWhen { if (it.discriminator == "dashboard") { val view = it.getView() tabPane.tab(view.title, view.root) } false } Manual handling of dynamic Views Create your first OSGi bundle A good starting point is the tornadofx-maven-osgi-project template in the TornadoFX IntelliJ IDEA plugin. This contains everything you need to build OSGi bundles from your sources. The OSGI IDEA plugin makes it very easy to setup and run an OSGi container directly from the IDE. There is a screencast at https://www.youtube.com/watch?v=liOFCH5MMKk that shows these concepts in action. OSGi Console TornadoFX has a built in OSGi console from which you can inspect bundles, change their state and even install new bundles with drag and drop. You can bring up the console with Alt-Meta-O or configure another shortcut by setting FX.osgiConsoleShortcut or programmatically opening the OSGIConsole View. 210

OSGi Requirements To run TornadoFX in an OSGi container, you need to load the required bundles. Usually this is a matter of dumping these jars into the bundle directory of the container. Note that any jar that is to be used in an OSGi container needs to be "OSGi enabled", which effectively means adding some OSGi specific entries the META-INF/MANIFEST.MF file. We provided a complete installation with Apache Felix and TornadoFX already installed at http://tornadofx.io/#felix. Remember to swap the tornadofx.jar for the latest version, as this bundle is most likely lagging a couple of versions behind. These are the required artifacts for any TornadoFX application running in an OSGi container. Your container might already be bundle with some of these, so check the container documentation for further details. 211

GUIDE
GUIDE
Guide
Guide
GUIDE
GUIDE
GUIDE
GUIDE
guide
GUIDE
Guide
GUIDE
Guide