@lestard lestard released this Mar 3, 2017 · 70 commits to stable since this release

Assets 23

Breaking Changes

  • #454: The validation feature was moved into it's own sub-module. This way it's possible to use the validation classes without importing the whole mvvmFX framework. If you are using the validator you have to add the new dependency to your maven/gradle build script:
<dependency>
        <groupId>de.saxsys</groupId>
        <artifactId>mvvmfx-validation</artifactId>
        <version>1.6.0</version>
</dependency>

The API and packages of the classes haven't changed so everything you have to do to get your build file.

  • #308: If using a dependency injection framework you can add @PostConstruct to methods to execute setup code after a class was created and has all dependencies injected. However, if you name this method "initialize" in a ViewModel then this conflicts with the initialization logic of the mvvmFX framework. In this case the method will be invoked 2 times. See the wiki for a detailed explanation. In this situation now an exception is thrown. To fix this you have to rename your @PostConstruct method. This change is potentially a breaking change for some users even though it's unlikely that this combination ever worked properly anyway. Thx to @sideisra for reporting and to @SirWindfield for fixing.

New Features and Improvements

  • #381: ViewModels now support a basic lifecycle to react on the event of the view being added to or removed from the Scene. This way you can implement cleanup logic in your ViewModels to prevent possible memory leaks.
    See the wiki page for more informations.
  • #349: Next to the existing CDI and Guice modules for dependency injection there is now a new module for the EasyDI dependency injection library. EasyDI is a small library for small to medium sized projects. While it's not as powerful as CDI or Guice, it has less configuration overhead and can be much faster then the other two in some situations. Thx to @SirWindfield for the implementation.
  • #443: It's now possible to add more complex validation rules to the ObservableRuleBasedValidator. Previously it was only possible to add ObservableBoolean rules with a fixed message. Now it's also possible to add an Observable<ValidationMessage>. This way you can define dynamic messages that are used when the validation fails. See the wiki for a short example. Thx to @gtnarg for the idea.
  • #423: The ModelWrapper now correctly sets the name attribute of each created JavaFX Property. Thx to @pkantner for the proposal.
  • #421: The ModelWrapper now has a method copyValuesTo which takes a model instance as argument and copies all current values of the wrapper into the provided model instance. Thx to @pkantner for the proposal.
  • #345: The ListTransformation class has a modelList property which is now renamed to sourceList. The new name better reflects what the class is doing by using "source" and "target" as terms. The old modelList property is still available but is now marked as deprecated and will be removed in a future version. Thx to @tranquility79 for implementation.

Bugfixes

  • #442: The DelegateCommand didn't provide access to an exception that was thrown by the executed action when the command was executed in synchronous mode. You can now access such exceptions with DelegateCommand.getException() method. Thx to @AKreisel for reporting and to @tranquility79 for fixing.
  • #399: A DelegateCommand wasn't able to be restarted properly. Thx to @tfleis for reporting.
  • #441: It was possible to subscribe to a NotificationCenter with null as subscriber. Later, when unsubscribe is invoked this was resulting in a NullPointerException.
  • #435: When a resourceBundle is injected with @InjectResourceBundle annotation then an exception should be thrown when no resourceBundle was provided when loading the scene. This wasn't the case anymore due to a regression in the code.
  • #426: Injecting a Scope Context with @InjectContext wasn't working when an existing ViewModel instance was used for loading the scene. Thx to @sideisra for reporting.
  • #419: The ListTransformation class was using an immutable list internally for the model list in some situations. This was resulting in UnsupportedOperationExcepion when new model elements are added to the model list, which of cause is a reasonable usage. Now a normal observable ArrayList is used.
  • #415: With version 1.51. we introduced a regression by changing the implementation hierarchy of the CompositeValidator which breaks custom ValidationMessage implementations. Thx to @gtnarg for reporting.

Documentation and examples