Drombler / drombler-fx

Drombler FX - the modular application framework for JavaFX.
https://www.drombler.org/drombler-fx
Other
60 stars 8 forks source link

What to do to add a new module #178

Closed claudio-rosati closed 7 years ago

claudio-rosati commented 7 years ago

I would like to know the best way to add a new module in a drombler-fx-based project. Must I start copying one of the sample modules or can I use the NetBeans Create New Module... command and select a Maven/OSGi Bundle project type? THank you for your help.

puce77 commented 7 years ago

It doesn't really matter. The only requirement is that you have an OSGi bundle in the end and add it as runtime dependency to the application bundle.

Personally, I often used the Maven/OSGi Bundle project type of NetBeans, but the trouble is that it generates too much, so you likely want to remove most of the generated stuff again.

I recommend to use Maven projects with "bundle" packaging type and make sure all your Maven projects have the same parent so you get the same versions of the dependencies and plugins.

You can create and use all sorts of bundles:

whatever fits you best.

claudio-rosati commented 7 years ago

I apologise for my ignorance (I've always worked with NetBeans RCP modules, never with OSGi), but from the files-to-be-modified point of view, what your "add it as runtime dependency to the application bundle" statements means?

Moreover, it it something that can be done at runtime (i.e. loading plug-ins at runtime)?

puce77 commented 7 years ago

Drombler FX loads all bundles in the bundle directory at startup time. You can add any bundle to this directory (sub-directory does not matter) and it will be picked-up.

When a Maven project has the packaging "drombler-fx-application" (the application project), then the Drombler FX Maven Plugin will copy the dependencies of this project to the bundle directory. Since these dependencies are usually just used at runtime, I recommend to set the scope of these dependencies to "runtime". See the POM file of the *-application project of the sample application for more details.

claudio-rosati commented 7 years ago

Thank you very much for your answer.

So whanting to have a way to "download and install" a new plug-in at runtime, it is sufficient to download a compressed version of the bundle, copy it in the bundle folder and restart the application.

Is it possible to restart the application programmatically? Is this kind of process (like NetBeans plug-ins) something that you already have in your plans?

I try to better explain the scope of my project: I ma the responsible at the European Spallation Source ERIC of the Control System Studio application, and Eclipse RCP based application. Most of the new development is made using JavaFX that runs badly inside the SWT canvas of Eclipse, this because most of us just don't like the SWT framework.

I'm now trying to setup a small prototype of an application based on a JavaFX framework to do the same things hoping to move most of the plugin made for CS-Studio into the new application.

This is why I need to understand if some of the feature vailable in frameworks lice Eclipse RCP or NetBeans RCP are planned for future releases of drombler-fx or not.

puce77 commented 7 years ago

Please join the discussion in issue #116 regarding update mechanisms.

puce77 commented 7 years ago

I'm closing this issue. Feel free to reopen it, if your question has not been answered.