afterburner.fx | The Opinionated Un-Framework For Java FX Applications
kandi X-RAY | afterburner.fx Summary
kandi X-RAY | afterburner.fx Summary
The opinionated just-enough MVP framework (2.5 classes) for JavaFX. Afterburner is a "Just-Enough-Framework" extracted from [airhacks-control] and used in [airpad] [lightfish] and [floyd] applications. Goal: "Less Code, Increased Productivity".
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Destroys all available services
- Recursively invoke method with given annotation class
- Gets default instance supplier
- Destroy method annotation
- Get the fxml file name
- Returns the name of the view
- Gets the name of a resource
- Strips the end of a class
- Returns the first child node without root container
- Loads a FXML component synchronously
- Discover presenter factories
- Adds the CSS if available
- Initialize the presenter
- Get a resource bundle by name
- Returns the bundle name
- Get the presenter
- Set configuration source
- Set custom configurator
- Registers presenter
- Creates the view asynchronously
- Set a model for the given class
- Gets the executor service
afterburner.fx Key Features
afterburner.fx Examples and Code Snippets
Community Discussions
Trending Discussions on afterburner.fx
QUESTION
I´ve created a small JavaFx Project with the use of the afterburner.fx framework. It works fine when I start it in the IDE (IntelliJ), but after I created a fat .jar out of it via the "maven-assembly-plugin" it fails to open the Second View.
Pom.xml:
...ANSWER
Answered 2018-Dec-20 at 17:57I found the Answer
Solution for me was just to rename the .fxml Files to start Uppercase: As an example I renamed view1.fxml to View1.fxml. I guess it has something to do with the way windows is accesing the files inside an jar/zip.
QUESTION
Afterburner.fx has broken for me and I can't seem to get it working again.
In my main method I have this:
...ANSWER
Answered 2018-Sep-26 at 00:05Since you're using Java 11 and module system, your resource output directory have to be in the same output directory as the module they belong to.
Judging by the images in your post, you're using gradle and you build your project directly from IDEA.
You need to tell IDE to copy your resources to the same output directory:
QUESTION
As the title goes, is it possible to inject objects into non-presenter/controller classes with afterburner.fx? Been trying to get it working but frankly making no progress.
...ANSWER
Answered 2018-Jun-28 at 17:04As you know, using the Afterburner framework injection works in presenter classes:
QUESTION
In my mainController I'm using the following method to change views:
...ANSWER
Answered 2018-Jun-03 at 22:21You can create a new fxml nodes only once per type:
QUESTION
I am using afterburner.fx http://afterburner.adam-bien.com/
It works as advertised. I can add multiple fxml Files to a central/main "view".
But if I want to add another fxml/presenter later, for example, using a button on a different navigationPane to add another fxml to the mainAnchorPane. Then it throws a NullPointerException.
...ANSWER
Answered 2017-Sep-11 at 21:53Afterburner.fx is a dependency-injection framework for JavaFX. The main functionality it provides is the ability to inject objects into the controllers/presenters that are created when you load an FXML file (by instantiating a subclass of FXMLView
). The basic process that happens when you instantiate a FXMLView
is:
- A new instance of the corresponding presenter is created
- The presenter is inspected to find any
@Inject
-annotated fields - For each
@Inject
-annotated field, if an instance of that type exists in the injector's cache, it is set as the value of that field. Otherwise, a new instance of that type is created and placed in the cache, and set as the value of the field.
The main point to note here is that the presenters themselves are treated differently to their dependencies. If you try (as in your code) to inject one presenter in another, an instance of the presenter class will be created specifically for injection purposes: this will not be the same instance that is created when the FXML file is loaded, and consequently it won't have any @FXML
-fields injected. This is why you get a null pointer exception: mainAnchorPane
is null in the ``MainScenePresenterthat is injected into the
NavigationPresenter`.
One presenter having a reference to another is generally a bad idea anyway: it creates unnecessary coupling between the two presenters. Instead, you should inject a model into both presenters that represents the state you want to share between them. In your case you might have something like
QUESTION
I want to create an app with JavaFX and I have a problem with separated views (splited by afterburner.fx) and the mvvm principal. In my scenario i have one view with a textfield and a button and a second view with a listview. Now I write some text in the textfield to add the text to the list by clicking the button. I have four classes (view and viewmodel for textfield/button and list). Now the question: How can I react to the buttonclick and transfer the text from the textfield to the list?
I can bind the text in the view and a property in the viewModel. But how can I transfer the value to the viewmodel of the list?
I hope somebody can help me with this understanding problem.
Big Thanks!
...ANSWER
Answered 2017-May-05 at 18:18The basic idea here is to use a single data model, which is shared among the components that need to access shared data. Using @Inject
in afterburner.fx will provide a convenient way to manage this for you.
For design patterns, the first thing to note is that afterburner.fx (and to a lesser extent, perhaps, the FXML-"controller" mechanism in general) is really based on a MVP pattern (not a MVVM pattern). The FXML file represents the (passive) view; the presenter is of course the presenter, and the model is implemented according to the application requirements.
Typically, the framework you are using is a big part of the decision about which pattern(s) to use, so I think my main recommendation would be to use a MVP pattern here. Using MVP, this looks like the following:
You can create an ObservableList
in your model:
QUESTION
I have a View1 with a Textfield1 and a Button. When i click a Button, i want to go to View 2 and set that Value to Textfield2 in View2. When i make it it go open a new Scene.
This is the Code to pass the Value:
...ANSWER
Answered 2017-Jan-07 at 11:43I suggest you use the Gluon templates Project MultiView with FXML and Afterburner, or the Glisten-Afterburner one. Either of them will allow you using injection and getting a valid instance of the presenters.
Solution 1. Glisten-Afterburner
Using the Glisten-Afterburner default template, I've added two TextField controls, one to each of the views.
The only thing you need is exposing a method to set the value on the second presenter:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install afterburner.fx
You can use afterburner.fx like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the afterburner.fx component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page