afterburner.fx provides:
- “Zero-Configuration” javax.inject.Inject DI of models or services into presenters.
- Convention-based unification of presenter, view, FXML and css.
- Conventional resource bundle loading.
- Injection of System.getProperties.
- Injection of presenter-local configuration properties (system properties are overriding the local configuration).
- Afterburner is a “Just-Enough-Framework” extracted from airhacks-control and used in airpad, lightfish and floyd applications
Jumpstart with:
mvn archetype:generate -Dfilter=com.airhacks:igniter
Afterburner is also available from maven central:
<dependency>
<groupId>com.airhacks</groupId>
<artifactId>afterburner.fx</artifactId>
<version>1.6.0</version>
</dependency>
The current development version is available as snapshot:
<dependency>
<groupId>com.airhacks</groupId>
<artifactId>afterburner.fx</artifactId>
<version>1.6.1-SNAPSHOT</version>
</dependency>
Simplistic example: https://github.com/AdamBien/followme.fx
Sample:
import com.airhacks.afterburner.views.FXMLView;
public class NoteListView extends FXMLView {
//usually nothing to do, FXML and CSS are automatically
//loaded and instantiated
}
public class AirpadPresenter implements Initializable {
@Inject // injected by afterburner, zero configuration required
NotesStore store;
@Inject // injected by afterburner from -Dhost=locahost (system properties)
String host;
@FXML // injected by FXML
AnchorPane noteList;
@Override
public void initialize(URL url, ResourceBundle rb) {
//view constructed from FXML
NoteListView noteListView = new NoteListView();
//fetching and integrating the view from FXML
Parent view = noteListView.getView();
this.noteList.getChildren().add(view);
}
afterburner.fx was extracted from https://github.com/AdamBien/airhacks-control, an attendee-management
application. afterburner.fx is used for the implementation of http://lightfish.adam-bien.com UI,
https://github.com/AdamBien/airpad and https://github.com/AdamBien/floyd