Skip to content

Commit

Permalink
Issue #1: Added templates for project generation
Browse files Browse the repository at this point in the history
  • Loading branch information
on-delete committed Mar 16, 2016
1 parent 74a6af2 commit 1e587dc
Show file tree
Hide file tree
Showing 51 changed files with 759 additions and 7 deletions.
2 changes: 2 additions & 0 deletions helloworld-cdi-gradle/.idea/description.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions helloworld-cdi-gradle/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
group 'mvvmfx.intellij.plugin'
version '1.0'

apply plugin: 'java'

sourceCompatibility = 1.8

repositories {
mavenCentral()
}

dependencies {
dependencies {
compile group: 'de.saxsys', name: 'mvvmfx', version: '1.4.1'
compile group: 'de.saxsys', name: 'mvvmfx-cdi', version: '1.4.1'
}
testCompile group: 'junit', name: 'junit', version: '4.11'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Wed Mar 16 13:52:51 CET 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-all.zip
27 changes: 27 additions & 0 deletions helloworld-cdi-gradle/src/main/java/App.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import de.saxsys.mvvmfx.FluentViewLoader;
import de.saxsys.mvvmfx.ViewTuple;
import de.saxsys.mvvmfx.cdi.MvvmfxCdiApplication;

import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class App extends MvvmfxCdiApplication {

public static void main(String... args) {
launch(args);
}


@Override
public void startMvvmfx(Stage stage) throws Exception {
stage.setTitle("Hello World Application");

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

Parent root = viewTuple.getView();
stage.setScene(new Scene(root));
stage.show();
}
}
22 changes: 22 additions & 0 deletions helloworld-cdi-gradle/src/main/java/HelloWorldView.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import de.saxsys.mvvmfx.FxmlView;
import de.saxsys.mvvmfx.InjectViewModel;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Label;

import java.net.URL;
import java.util.ResourceBundle;

public class HelloWorldView implements FxmlView<HelloWorldViewModel>, Initializable {

@FXML
private Label helloLabel;

@InjectViewModel
private HelloWorldViewModel viewModel;

@Override
public void initialize(URL location, ResourceBundle resources) {
helloLabel.textProperty().bind(viewModel.helloMessage());
}
}
20 changes: 20 additions & 0 deletions helloworld-cdi-gradle/src/main/java/HelloWorldViewModel.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import de.saxsys.mvvmfx.ViewModel;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;

public class HelloWorldViewModel implements ViewModel {

private StringProperty helloMessage = new SimpleStringProperty("Hello World");

public StringProperty helloMessage(){
return helloMessage;
}

public String getHelloMessage(){
return helloMessage.get();
}

public void setHelloMessage(String message){
helloMessage.set(message);
}
}
14 changes: 14 additions & 0 deletions helloworld-cdi-gradle/src/main/resources/HelloWorldView.fxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.VBox?>
<VBox alignment="CENTER" xmlns:fx="http://javafx.com/fxml" prefWidth="600" prefHeight="400"
fx:controller="HelloWorldView">
<children>
<Label fx:id="helloLabel"/>
</children>
<padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
</padding>
</VBox>
21 changes: 21 additions & 0 deletions helloworld-cdi-gradle/src/main/resources/META-INF/beans.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2013 Alexander Casall
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<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: 2 additions & 0 deletions helloworld-cdi-maven/.idea/description.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions helloworld-cdi-maven/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?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">
<modelVersion>4.0.0</modelVersion>

<groupId>mvvmfx.intellij.plugin</groupId>
<artifactId>helloworld-cdi-maven</artifactId>
<version>1.0</version>

<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>1.4.1</version>
</dependency>
<dependency>
<groupId>de.saxsys</groupId>
<artifactId>mvvmfx-cdi</artifactId>
<version>1.4.1</version>
</dependency>
</dependencies>
</project>
27 changes: 27 additions & 0 deletions helloworld-cdi-maven/src/main/java/App.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import de.saxsys.mvvmfx.FluentViewLoader;
import de.saxsys.mvvmfx.ViewTuple;
import de.saxsys.mvvmfx.cdi.MvvmfxCdiApplication;
import javafx.application.Application;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class App extends MvvmfxCdiApplication {

public static void main(String... args) {
launch(args);
}


@Override
public void startMvvmfx(Stage stage) throws Exception {
stage.setTitle("Hello World Application");

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

Parent root = viewTuple.getView();
stage.setScene(new Scene(root));
stage.show();
}
}
22 changes: 22 additions & 0 deletions helloworld-cdi-maven/src/main/java/HelloWorldView.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import de.saxsys.mvvmfx.FxmlView;
import de.saxsys.mvvmfx.InjectViewModel;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Label;

import java.net.URL;
import java.util.ResourceBundle;

public class HelloWorldView implements FxmlView<HelloWorldViewModel>, Initializable {

@FXML
private Label helloLabel;

@InjectViewModel
private HelloWorldViewModel viewModel;

@Override
public void initialize(URL location, ResourceBundle resources) {
helloLabel.textProperty().bind(viewModel.helloMessage());
}
}
20 changes: 20 additions & 0 deletions helloworld-cdi-maven/src/main/java/HelloWorldViewModel.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import de.saxsys.mvvmfx.ViewModel;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;

public class HelloWorldViewModel implements ViewModel {

private StringProperty helloMessage = new SimpleStringProperty("Hello World");

public StringProperty helloMessage(){
return helloMessage;
}

public String getHelloMessage(){
return helloMessage.get();
}

public void setHelloMessage(String message){
helloMessage.set(message);
}
}
14 changes: 14 additions & 0 deletions helloworld-cdi-maven/src/main/resources/HelloWorldView.fxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.VBox?>
<VBox alignment="CENTER" xmlns:fx="http://javafx.com/fxml" prefWidth="600" prefHeight="400"
fx:controller="HelloWorldView">
<children>
<Label fx:id="helloLabel"/>
</children>
<padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
</padding>
</VBox>
21 changes: 21 additions & 0 deletions helloworld-cdi-maven/src/main/resources/META-INF/beans.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2013 Alexander Casall
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<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: 2 additions & 0 deletions helloworld-gradle/.idea/description.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions helloworld-gradle/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
group 'mvvmfx.intellij.plugin'
version '1.0'

apply plugin: 'java'

sourceCompatibility = 1.8

repositories {
mavenCentral()
}

dependencies {
dependencies {
compile group: 'de.saxsys', name: 'mvvmfx', version: '1.4.1'
}
testCompile group: 'junit', name: 'junit', version: '4.11'
}
6 changes: 6 additions & 0 deletions helloworld-gradle/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Wed Mar 16 11:14:01 CET 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-all.zip
26 changes: 26 additions & 0 deletions helloworld-gradle/src/main/java/App.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import de.saxsys.mvvmfx.FluentViewLoader;
import de.saxsys.mvvmfx.ViewTuple;
import javafx.application.Application;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class App extends Application {

public static void main(String... args) {
launch(args);
}


@Override
public void start(Stage stage) throws Exception {
stage.setTitle("Hello World Application");

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

Parent root = viewTuple.getView();
stage.setScene(new Scene(root));
stage.show();
}
}
22 changes: 22 additions & 0 deletions helloworld-gradle/src/main/java/HelloWorldView.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import de.saxsys.mvvmfx.FxmlView;
import de.saxsys.mvvmfx.InjectViewModel;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Label;

import java.net.URL;
import java.util.ResourceBundle;

public class HelloWorldView implements FxmlView<HelloWorldViewModel>, Initializable {

@FXML
private Label helloLabel;

@InjectViewModel
private HelloWorldViewModel viewModel;

@Override
public void initialize(URL location, ResourceBundle resources) {
helloLabel.textProperty().bind(viewModel.helloMessage());
}
}
20 changes: 20 additions & 0 deletions helloworld-gradle/src/main/java/HelloWorldViewModel.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import de.saxsys.mvvmfx.ViewModel;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;

public class HelloWorldViewModel implements ViewModel {

private StringProperty helloMessage = new SimpleStringProperty("Hello World");

public StringProperty helloMessage(){
return helloMessage;
}

public String getHelloMessage(){
return helloMessage.get();
}

public void setHelloMessage(String message){
helloMessage.set(message);
}
}
Loading

0 comments on commit 1e587dc

Please sign in to comment.