Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

319 javaview without vm type #320

Merged
merged 7 commits into from
Nov 3, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ env:

after_success:
- chmod ugo+x travis_snapshot_release.sh
- ./travis_snapshot_release.sh
- ./travis_snapshot_release.sh
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,38 @@ __MVVM__ is the enhanced version of the [Presentation Model](http://martinfowler
### Maven dependency###

#### Stable Release
```

This is the stable release that can be used in production.

```xml
<dependency>
<groupId>de.saxsys</groupId>
<artifactId>mvvmfx</artifactId>
<version>1.4.0</version>
</dependency>
```

#### Bugfix Development Snapshot

Here we make bug fixes for the current stable release.

```xml
<dependency>
<groupId>de.saxsys</groupId>
<artifactId>mvvmfx</artifactId>
<version>1.4.1-SNAPSHOT</version>
</dependency>
```

#### Development Snapshot

Here we develop new features. This release is unstable and shouldn't be used in production.

```
<dependency>
<groupId>de.saxsys</groupId>
<artifactId>mvvmfx</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>
</dependency>
```

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

Expand Down
2 changes: 1 addition & 1 deletion examples/contacts-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>de.saxsys.mvvmfx</groupId>
<artifactId>examples</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>
</parent>
<artifactId>contacts-example</artifactId>

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

Expand Down
2 changes: 1 addition & 1 deletion examples/mini-examples/helloworld-without-fxml/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mini-examples</artifactId>
<groupId>de.saxsys.mvvmfx</groupId>
<version>1.4.1-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

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

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

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

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

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

Expand Down
2 changes: 1 addition & 1 deletion mvvmfx-archetype/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>de.saxsys</groupId>
<artifactId>mvvmfx-parent</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>
</parent>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<dependency>
<groupId>de.saxsys</groupId>
<artifactId>mvvmfx-parent</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
2 changes: 1 addition & 1 deletion mvvmfx-cdi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>de.saxsys</groupId>
<artifactId>mvvmfx-parent</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>
</parent>

<artifactId>mvvmfx-cdi</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion mvvmfx-guice/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>de.saxsys</groupId>
<artifactId>mvvmfx-parent</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>
</parent>

<artifactId>mvvmfx-guice</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion mvvmfx-testing-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mvvmfx-parent</artifactId>
<groupId>de.saxsys</groupId>
<version>1.4.1-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

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

Expand Down
2 changes: 1 addition & 1 deletion mvvmfx/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>de.saxsys</groupId>
<artifactId>mvvmfx-parent</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>
</parent>

<artifactId>mvvmfx</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,18 @@
******************************************************************************/
package de.saxsys.mvvmfx.internal.viewloader;

import java.io.IOException;
import java.net.URL;
import java.util.Optional;
import java.util.ResourceBundle;

import de.saxsys.mvvmfx.ViewModel;
import de.saxsys.mvvmfx.ViewTuple;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.util.Callback;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import de.saxsys.mvvmfx.ViewModel;
import de.saxsys.mvvmfx.ViewTuple;
import java.io.IOException;
import java.net.URL;
import java.util.Optional;
import java.util.ResourceBundle;

/**
* This viewLoader is used to load views that are implementing {@link de.saxsys.mvvmfx.FxmlView}.
Expand All @@ -52,12 +50,12 @@ public class FxmlViewLoader {
* the root object that is passed to the {@link javafx.fxml.FXMLLoader}
* @param viewModel
* the viewModel instance that is used when loading the viewTuple.
*
*
* @param <ViewType>
* the generic type of the view.
* @param <ViewModelType>
* the generic type of the viewModel.
*
*
* @return the loaded ViewTuple.
*/
public <ViewType extends View<? extends ViewModelType>, ViewModelType extends ViewModel> ViewTuple<ViewType, ViewModelType> loadFxmlViewTuple(
Expand Down Expand Up @@ -102,7 +100,7 @@ private String createFxmlPath(Class<?> viewType) {
*
* @param resource
* the string path to the fxml file that is loaded.
*
*
* @param resourceBundle
* the resourceBundle that is passed to the {@link javafx.fxml.FXMLLoader}.
* @param codeBehind
Expand All @@ -111,12 +109,12 @@ private String createFxmlPath(Class<?> viewType) {
* the root object that is passed to the {@link javafx.fxml.FXMLLoader}
* @param viewModel
* the viewModel instance that is used when loading the viewTuple.
*
*
* @param <ViewType>
* the generic type of the view.
* @param <ViewModelType>
* the generic type of the viewModel.
*
*
* @return the loaded ViewTuple.
*/
public <ViewType extends View<? extends ViewModelType>, ViewModelType extends ViewModel> ViewTuple<ViewType, ViewModelType> loadFxmlViewTuple(
Expand Down Expand Up @@ -165,8 +163,8 @@ public <ViewType extends View<? extends ViewModelType>, ViewModelType extends Vi

private FXMLLoader createFxmlLoader(String resource, ResourceBundle resourceBundle, View codeBehind, Object root,
ViewModel viewModel)
throws IOException {
throws IOException {

// Load FXML file
final URL location = FxmlViewLoader.class.getResource(resource);
if (location == null) {
Expand Down Expand Up @@ -207,7 +205,7 @@ private FXMLLoader createFxmlLoader(String resource, ResourceBundle resourceBund
* a view.
*/
private static class DefaultControllerFactory implements Callback<Class<?>, Object> {
private ResourceBundle resourceBundle;
private final ResourceBundle resourceBundle;

public DefaultControllerFactory(ResourceBundle resourceBundle) {
this.resourceBundle = resourceBundle;
Expand Down Expand Up @@ -276,9 +274,9 @@ private static class ControllerFactoryForCustomViewModel implements Callback<Cla

private boolean customViewModelInjected = false;

private ViewModel customViewModel;
private final ViewModel customViewModel;

private ResourceBundle resourceBundle;
private final ResourceBundle resourceBundle;

public ControllerFactoryForCustomViewModel(ViewModel customViewModel, ResourceBundle resourceBundle) {
this.customViewModel = customViewModel;
Expand Down
Loading