Skip to content

Commit

Permalink
Merge pull request #259 from sialcasa/develop
Browse files Browse the repository at this point in the history
merge version 1.3.0 into stable branch
  • Loading branch information
manuel-mauky committed Jun 10, 2015
2 parents 2522843 + cdd64e7 commit ccd7cac
Show file tree
Hide file tree
Showing 99 changed files with 2,788 additions and 397 deletions.
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ jdk:

install: true

script:
- sudo apt-get update && sudo apt-get install oracle-java8-installer
- java -version

before_install:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sudo apt-get update && sudo apt-get install oracle-java8-installer
- java -version

env:
global:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ __mvvm(fx)__ is an application framework which provides you necessary components

__MVVM__ is the enhanced version of the [Presentation Model](http://martinfowler.com/eaaDev/PresentationModel.html "Presentation Model") pattern and was created by Microsoft engineers for [WPF](http://msdn.microsoft.com/en-us/library/ms754130.aspx "WPF") . JavaFX and WPF does have similarities like Databinding and descriptive UI declaration (FXML/XAML). Because of this fact we adopt best practices of the development with the Microsoft technology.

[![Build Status](https://travis-ci.org/sialcasa/mvvmFX.svg?branch=develop)](https://travis-ci.org/sialcasa/mvvmFX)
[![Build Status](https://api.travis-ci.org/sialcasa/mvvmFX.svg?branch=develop)](https://travis-ci.org/sialcasa/mvvmFX)

###[Howto](../../wiki "Howto")###

Expand Down
2 changes: 1 addition & 1 deletion examples/mvvmfx-books-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mvvmfx-examples</artifactId>
<groupId>de.saxsys</groupId>
<version>1.2.1</version>
<version>1.3.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
7 changes: 6 additions & 1 deletion examples/mvvmfx-cdi-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>de.saxsys</groupId>
<artifactId>mvvmfx-examples</artifactId>
<version>1.2.1</version>
<version>1.3.0</version>
</parent>

<properties>
Expand Down Expand Up @@ -43,6 +43,11 @@
<artifactId>mvvmfx-complex</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jandex</artifactId>
<version>1.2.4.Final</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee">


</beans>
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
bean-discovery-mode="all">
</beans>
2 changes: 1 addition & 1 deletion examples/mvvmfx-complex-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>de.saxsys</groupId>
<artifactId>mvvmfx-examples</artifactId>
<version>1.2.1</version>
<version>1.3.0</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee">


</beans>
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
bean-discovery-mode="all">
</beans>
19 changes: 16 additions & 3 deletions examples/mvvmfx-contacts/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>mvvmfx-examples</artifactId>
<groupId>de.saxsys</groupId>
<version>1.2.1</version>
<version>1.3.0</version>
</parent>
<artifactId>mvvmfx-contacts</artifactId>

Expand Down Expand Up @@ -40,6 +40,12 @@
<artifactId>mvvmfx-cdi</artifactId>
<version>${project.parent.version}</version>
</dependency>

<dependency>
<groupId>org.jboss</groupId>
<artifactId>jandex</artifactId>
<version>1.2.4.Final</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
Expand All @@ -48,7 +54,7 @@
<dependency>
<groupId>org.controlsfx</groupId>
<artifactId>controlsfx</artifactId>
<version>8.0.6</version>
<version>8.40.9</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -104,9 +110,16 @@
<dependency>
<groupId>org.testfx</groupId>
<artifactId>testfx-core</artifactId>
<version>4.0.0-SNAPSHOT</version>
<version>4.0.1-alpha</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>de.saxsys</groupId>
<artifactId>mvvmfx-testing-utils</artifactId>
<version>${project.parent.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package de.saxsys.mvvmfx.contacts;

import java.util.Locale;
import java.util.ResourceBundle;

import de.saxsys.mvvmfx.MvvmFX;
import javafx.application.Platform;
import javafx.scene.Scene;
import javafx.stage.Stage;
Expand All @@ -25,6 +28,9 @@ public class App extends MvvmfxCdiApplication {
private static final Logger LOG = LoggerFactory.getLogger(App.class);

public static void main(String... args) {

Locale.setDefault(Locale.ENGLISH);

launch(args);
}

Expand All @@ -46,11 +52,11 @@ public void initMvvmfx() throws Exception {
@Override
public void startMvvmfx(Stage stage) throws Exception {
LOG.info("Starting the Application");
MvvmFX.setGlobalResourceBundle(resourceBundle);

stage.setTitle(resourceBundle.getString("window.title"));

ViewTuple<MainView, MainViewModel> main = FluentViewLoader.fxmlView(MainView.class)
.resourceBundle(resourceBundle).load();
ViewTuple<MainView, MainViewModel> main = FluentViewLoader.fxmlView(MainView.class).load();


Scene rootScene = new Scene(main.getView());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ public class ResourceProvider {
* Due to the @Produces annotation this resource bundle can be injected in all views.
*/
@Produces
private ResourceBundle defaultResourceBundle = ResourceBundle.getBundle("default", Locale.ENGLISH);
private ResourceBundle defaultResourceBundle = ResourceBundle.getBundle("default");

}

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package de.saxsys.mvvmfx.contacts.ui.about;

import java.util.ResourceBundle;

import javafx.fxml.FXML;
import javafx.scene.Parent;
import javafx.scene.control.Hyperlink;
Expand All @@ -16,7 +14,6 @@
import de.saxsys.mvvmfx.FluentViewLoader;
import de.saxsys.mvvmfx.FxmlView;
import de.saxsys.mvvmfx.InjectViewModel;
import de.saxsys.mvvmfx.ViewTuple;
import de.saxsys.mvvmfx.contacts.events.OpenAboutDialogEvent;
import de.saxsys.mvvmfx.contacts.util.DialogHelper;

Expand All @@ -35,10 +32,10 @@ public class AboutView implements FxmlView<AboutViewModel> {
private Parent root;

@Inject
AboutView(ResourceBundle defaultResourceBundle) {
ViewTuple<AboutView, AboutViewModel> viewTuple = FluentViewLoader.fxmlView(AboutView.class).codeBehind(this)
.resourceBundle(defaultResourceBundle).load();
root = viewTuple.getView();
AboutView() {
root = FluentViewLoader.fxmlView(AboutView.class)
.codeBehind(this)
.load().getView();
}

public void initialize() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ public class AddContactDialog implements FxmlView<AddContactDialogViewModel> {
private Parent root;

@Inject
AddContactDialog(ResourceBundle defaultResourceBundle) {
ViewTuple<AddContactDialog, AddContactDialogViewModel> viewTuple = FluentViewLoader
AddContactDialog() {
root = FluentViewLoader
.fxmlView(AddContactDialog.class)
.codeBehind(this).resourceBundle(defaultResourceBundle).load();

root = viewTuple.getView();
.codeBehind(this)
.load()
.getView();
}

public void initialize() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,16 @@ public class ContactDialogView implements FxmlView<ContactDialogViewModel> {
private Pagination formPagination;


private ResourceBundle defaultResourceBundle;

@InjectViewModel
private ContactDialogViewModel viewModel;

@Inject
public ContactDialogView(ResourceBundle defaultResourceBundle) {
this.defaultResourceBundle = defaultResourceBundle;
}

public void initialize() {
ViewTuple<ContactFormView, ContactFormViewModel> contactFormTuple = FluentViewLoader
.fxmlView(ContactFormView.class)
.resourceBundle(defaultResourceBundle).load();
.fxmlView(ContactFormView.class).load();

ViewTuple<AddressFormView, AddressFormViewModel> addressFormTuple = FluentViewLoader
.fxmlView(AddressFormView.class)
.resourceBundle(defaultResourceBundle).load();
.fxmlView(AddressFormView.class).load();

viewModel.setContactFormViewModel(contactFormTuple.getViewModel());
viewModel.setAddressFormViewModel(addressFormTuple.getViewModel());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
package de.saxsys.mvvmfx.contacts.ui.contactdialog;

import javafx.beans.binding.Bindings;
import javafx.beans.binding.BooleanBinding;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.ReadOnlyBooleanProperty;
import javafx.beans.property.ReadOnlyBooleanWrapper;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.beans.property.*;
import javafx.beans.value.ObservableBooleanValue;

import de.saxsys.mvvmfx.ViewModel;
import de.saxsys.mvvmfx.contacts.ui.addressform.AddressFormViewModel;
import de.saxsys.mvvmfx.contacts.ui.contactform.ContactFormViewModel;
Expand All @@ -36,7 +31,7 @@ public ContactDialogViewModel() {
// as soon as both viewModels are set we add a binding that is true only when both viewModels are valid.
viewModelsInitialized.addListener((obs, oldV, newV) -> {
if (newV) {
valid.bind(contactFormViewModel.get().validProperty().and(addressFormViewModel.get().validProperty()));
valid.bind(Bindings.and(contactFormViewModel.get().validProperty(), addressFormViewModel.get().validProperty()));
} else {
valid.unbind();
}
Expand Down Expand Up @@ -96,7 +91,7 @@ public IntegerProperty dialogPageProperty() {


public ObservableBooleanValue okButtonDisabledProperty() {
return contactFormViewModel.get().validProperty().and(addressFormViewModel.get().validProperty()).not();
return Bindings.and(contactFormViewModel.get().validProperty(), addressFormViewModel.get().validProperty()).not();
}

public ObservableBooleanValue okButtonVisibleProperty() {
Expand Down
Loading

0 comments on commit ccd7cac

Please sign in to comment.