Skip to content

Commit

Permalink
#82 Changed 3 examples to use the new FluentViewLoader.
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-mauky committed Jul 29, 2014
1 parent d3e6dc5 commit 5ec27ef
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package de.saxsys.jfx.mvvmfx.fx_root_example;

import de.saxsys.jfx.mvvm.viewloader.FluentViewLoader;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
Expand All @@ -25,9 +26,7 @@ public class LabeledTextField extends HBox implements FxmlView<LabeledTextFieldV
private LabeledTextFieldViewModel viewModel;

public LabeledTextField() {
ViewLoader viewLoader = new ViewLoader();

viewLoader.loadViewTuple(this.getClass(), null, this, this);
FluentViewLoader.fxmlView(this.getClass()).root(this).codeBehind(this).load();
}

public void initialize() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package de.saxsys.jfx.mvvmfx.helloworld;


import de.saxsys.jfx.mvvm.viewloader.FluentViewLoader;
import javafx.application.Application;
import javafx.scene.Parent;
import javafx.scene.Scene;
Expand All @@ -21,10 +22,7 @@ public static void main(String... args) {
public void start(Stage stage) throws Exception {
stage.setTitle("Hello World Application");

ViewLoader viewLoader = new ViewLoader();

ViewTuple<HelloWorldView, HelloWorldViewModel> viewTuple = viewLoader
.loadViewTuple(HelloWorldView.class);
ViewTuple<HelloWorldView, HelloWorldViewModel> viewTuple = FluentViewLoader.javaView(HelloWorldView.class).load();

Parent root = viewTuple.getView();
stage.setScene(new Scene(root));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package de.saxsys.jfx.mvvmfx.helloworld;

import de.saxsys.jfx.mvvm.viewloader.FluentViewLoader;
import javafx.application.Application;
import javafx.scene.Parent;
import javafx.scene.Scene;
Expand All @@ -20,11 +21,8 @@ public static void main(String... args) {
@Override
public void start(Stage stage) throws Exception {
stage.setTitle("Hello World Application");

ViewLoader viewLoader = new ViewLoader();

ViewTuple<HelloWorldView, HelloWorldViewModel> viewTuple = viewLoader
.loadViewTuple(HelloWorldView.class);

ViewTuple<HelloWorldView, HelloWorldViewModel> viewTuple = FluentViewLoader.fxmlView(HelloWorldView.class).load();

Parent root = viewTuple.getView();
stage.setScene(new Scene(root));
Expand Down

0 comments on commit 5ec27ef

Please sign in to comment.