-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
57 changed files
with
1,291 additions
and
316 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/sh | ||
|
||
# Script for the deployment of releases to maven central | ||
# | ||
# Expecting a "settings-mvvmfx.xml" file in maven_home with the authentication configuration for the central repository. | ||
# | ||
# The settings file should look something like this: | ||
# | ||
# <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" | ||
# xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
# xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 | ||
# http://maven.apache.org/xsd/settings-1.0.0.xsd"> | ||
# | ||
# <servers> | ||
# <server> | ||
# <id>sonatype-nexus-snapshots</id> | ||
# <username>YOUR USERNAME</username> | ||
# <password>YOUR PASSWORD</password> | ||
# </server> | ||
# <server> | ||
# <id>sonatype-nexus-staging</id> | ||
# <username>YOUR USERNAME</username> | ||
# <password>YOUR PASSWORD</password> | ||
# </server> | ||
# </servers> | ||
# </settings> | ||
|
||
mvn clean deploy -pl 'mvvmfx,mvvmfx-cdi,mvvmfx-guice,mvvmfx-archetype' -am -DskipTests=true -Pdeploy-release --settings ~/.m2/settings-mvvmfx.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# MvvmFX Books Example | ||
|
||
This example app is a client for a library REST service. You can search for books and view the | ||
details of found books in a master-detail view. | ||
|
||
![screenshot](screenshot.png) | ||
|
||
This example was used for [a talk](http://www.jug-gr.de/2014/12/03/model-view-star.html) at the | ||
[JavaUserGroup Görlitz](http://www.jug-gr.de) on [UI-Design patterns](https://github.com/lestard/model-view-star). | ||
|
||
Originally [this app](https://github.com/sbley/hypermedia-library-client/tree/javafx) was created by [Stefan Bley](https://github.com/sbley) and | ||
[Alexander Casall](https://github.com/sialcasa) for a talk on Hypermedia-APIs. | ||
To run the app you need to have the [Hypermedia-API server](https://github.com/sbley/hypermedia-library-server) | ||
up and running on `localhost` so that the client can make the necessary REST-Requests. | ||
|
||
|
||
The app uses the following libraries (among others): | ||
|
||
- [FontAwesomeFX](https://bitbucket.org/Jerady/fontawesomefx) // Icons | ||
- [FlatterFX](http://www.guigarage.com/javafx-themes/flatter/) // Styling | ||
- [Advanced-Bindings](https://github.com/lestard/advanced-bindings) // Binding-Utils | ||
- [EasyDI](https://github.com/lestard/EasyDI) // Dependency-Injection | ||
- [AssertJ-JavaFX](https://github.com/lestard/assertj-javafx) // Testing | ||
- [HALBuilder](https://github.com/HalBuilder) // REST-Client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>mvvmfx-examples</artifactId> | ||
<groupId>de.saxsys</groupId> | ||
<version>1.0.0</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>mvvmfx-library-example</artifactId> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>de.saxsys</groupId> | ||
<artifactId>mvvmfx</artifactId> | ||
<version>${project.parent.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>eu.lestard</groupId> | ||
<artifactId>easy-di</artifactId> | ||
<version>0.1.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>de.jensd</groupId> | ||
<artifactId>fontawesomefx</artifactId> | ||
<version>8.0.10</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.guigarage</groupId> | ||
<artifactId>flatter</artifactId> | ||
<version>0.7</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>eu.lestard</groupId> | ||
<artifactId>advanced-bindings</artifactId> | ||
<version>0.2.0</version> | ||
</dependency> | ||
|
||
<!-- Backend --> | ||
<dependency> | ||
<groupId>com.theoryinpractise</groupId> | ||
<artifactId>halbuilder-json</artifactId> | ||
<version>4.0.2</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.theoryinpractise</groupId> | ||
<artifactId>halbuilder-jaxrs</artifactId> | ||
<version>1.1.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss.resteasy</groupId> | ||
<artifactId>resteasy-client</artifactId> | ||
<version>3.0.9.Final</version> | ||
</dependency> | ||
|
||
|
||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>ch.qos.logback</groupId> | ||
<artifactId>logback-classic</artifactId> | ||
<version>1.1.2</version> | ||
</dependency> | ||
|
||
|
||
<!-- Testing --> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.assertj</groupId> | ||
<artifactId>assertj-core</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>eu.lestard</groupId> | ||
<artifactId>assertj-javafx</artifactId> | ||
<version>0.2.0</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.mockito</groupId> | ||
<artifactId>mockito-all</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
|
||
</project> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions
40
examples/mvvmfx-books-example/src/main/java/de/saxsys/mvvmfx/examples/books/App.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package de.saxsys.mvvmfx.examples.books; | ||
|
||
import com.guigarage.flatterfx.FlatterFX; | ||
import com.guigarage.flatterfx.FlatterInputType; | ||
import de.saxsys.mvvmfx.FluentViewLoader; | ||
import de.saxsys.mvvmfx.MvvmFX; | ||
import de.saxsys.mvvmfx.examples.books.backend.LibraryService; | ||
import de.saxsys.mvvmfx.examples.books.backend.LibraryServiceImpl; | ||
import eu.lestard.easydi.EasyDI; | ||
import javafx.application.Application; | ||
import javafx.scene.Scene; | ||
import javafx.scene.paint.Color; | ||
import javafx.stage.Stage; | ||
|
||
public class App extends Application { | ||
|
||
public static void main(String[] args) { | ||
launch(args); | ||
} | ||
|
||
@Override | ||
public void start(Stage primaryStage) throws Exception { | ||
EasyDI context = new EasyDI(); | ||
context.bindInterface(LibraryService.class, LibraryServiceImpl.class); | ||
MvvmFX.setCustomDependencyInjector(context::getInstance); | ||
|
||
primaryStage.setTitle("Library JavaFX"); | ||
primaryStage.setMinWidth(1200); | ||
primaryStage.setMaxWidth(1200); | ||
primaryStage.setMinHeight(700); | ||
|
||
Scene scene = new Scene(FluentViewLoader.fxmlView(MainView.class).load().getView(), 1200, 700); | ||
|
||
scene.setFill(Color.TRANSPARENT); | ||
primaryStage.setScene(scene); | ||
primaryStage.show(); | ||
FlatterFX.style(FlatterInputType.DEFAULT); | ||
} | ||
} | ||
|
30 changes: 30 additions & 0 deletions
30
...les/mvvmfx-books-example/src/main/java/de/saxsys/mvvmfx/examples/books/BookViewModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package de.saxsys.mvvmfx.examples.books; | ||
|
||
|
||
import de.saxsys.mvvmfx.examples.books.backend.Book; | ||
|
||
public class BookViewModel { | ||
|
||
private final Book book; | ||
|
||
public BookViewModel(Book book){ | ||
this.book = book; | ||
} | ||
|
||
public String getTitle(){ | ||
return book.getTitle(); | ||
} | ||
|
||
public String getAuthor(){ | ||
return book.getAuthor(); | ||
} | ||
|
||
public String getDescription(){ | ||
return book.getDesc(); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return getTitle(); | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
examples/mvvmfx-books-example/src/main/java/de/saxsys/mvvmfx/examples/books/MainView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package de.saxsys.mvvmfx.examples.books; | ||
|
||
import de.saxsys.mvvmfx.FxmlView; | ||
import de.saxsys.mvvmfx.InjectViewModel; | ||
import javafx.fxml.FXML; | ||
import javafx.scene.control.Button; | ||
import javafx.scene.control.Label; | ||
import javafx.scene.control.ListView; | ||
import javafx.scene.control.TextField; | ||
|
||
public class MainView implements FxmlView<MainViewModel> { | ||
|
||
|
||
@FXML | ||
private Label titleLabel; | ||
|
||
@FXML | ||
private Label authorLabel; | ||
|
||
@FXML | ||
private TextField searchTextField; | ||
|
||
@FXML | ||
private Button searchButton; | ||
|
||
@FXML | ||
private Label descriptionLabel; | ||
|
||
@FXML | ||
private ListView<BookViewModel> bookList; | ||
|
||
@FXML | ||
private Label errorLabel; | ||
|
||
@InjectViewModel | ||
private MainViewModel viewModel; | ||
|
||
public void initialize(){ | ||
searchTextField.textProperty().bindBidirectional(viewModel.searchStringProperty()); | ||
titleLabel.textProperty().bind(viewModel.bookTitleProperty()); | ||
authorLabel.textProperty().bind(viewModel.bookAuthorProperty()); | ||
descriptionLabel.textProperty().bind(viewModel.bookDescriptionProperty()); | ||
|
||
bookList.setItems(viewModel.booksProperty()); | ||
|
||
viewModel.selectedBookProperty().bind(bookList.getSelectionModel().selectedItemProperty()); | ||
errorLabel.textProperty().bind(viewModel.errorProperty()); | ||
} | ||
|
||
public void searchButtonPressed() { | ||
viewModel.search(); | ||
} | ||
} |
Oops, something went wrong.