Skip to content

Commit

Permalink
Initial commit. Added the complete application.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tuupertunut committed Jul 28, 2017
0 parents commit b8cedd8
Show file tree
Hide file tree
Showing 20 changed files with 616 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/build/
/nbproject/private/
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2017 Tuupertunut

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# FXML templates

Netbeans plugin for creating standalone FXML Nodes to JavaFX projects.

This plugin adds two new creatable file types under the JavaFX category:

### JavaFX FXML Node

Creates two files. One FXML file and one Java class file which works as both the root and controller of the FXML. The Java file works as a standalone Node, meaning it can be added as a child to other Nodes.

### JavaFX FXML Application

Creates three files. A JavaFX application main class and one JavaFX FXML Node, as described in the previous section. The node is used as the root node of the application.
8 changes: 8 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
<!-- for some information on what you could do (e.g. targets to override). -->
<!-- If you delete this file and reopen the project it will be recreated. -->
<project name="tuupertunut.fxmltemplates" default="netbeans" basedir=".">
<description>Builds, tests, and runs the project tuupertunut.fxmltemplates.</description>
<import file="nbproject/build-impl.xml"/>
</project>
8 changes: 8 additions & 0 deletions manifest.mf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Manifest-Version: 1.0
AutoUpdate-Show-In-Client: true
OpenIDE-Module: tuupertunut.fxmltemplates
OpenIDE-Module-Layer: tuupertunut/fxmltemplates/layer.xml
OpenIDE-Module-Localizing-Bundle: tuupertunut/fxmltemplates/Bundle.properties
OpenIDE-Module-Needs: org.netbeans.api.templates.wizard, javax.script.ScriptEngine.freemarker
OpenIDE-Module-Specification-Version: 1.0

42 changes: 42 additions & 0 deletions nbproject/build-impl.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
*** GENERATED FROM project.xml - DO NOT EDIT ***
*** EDIT ../build.xml INSTEAD ***
-->
<project name="tuupertunut.fxmltemplates-impl" basedir="..">
<fail message="Please build using Ant 1.7.1 or higher.">
<condition>
<not>
<antversion atleast="1.7.1"/>
</not>
</condition>
</fail>
<property file="nbproject/private/platform-private.properties"/>
<property file="nbproject/platform.properties"/>
<macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2">
<attribute name="name"/>
<attribute name="value"/>
<sequential>
<property name="@{name}" value="${@{value}}"/>
</sequential>
</macrodef>
<macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2">
<attribute name="property"/>
<attribute name="value"/>
<sequential>
<property name="@{property}" value="@{value}"/>
</sequential>
</macrodef>
<property file="${user.properties.file}"/>
<nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
<nbmproject2:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
<nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
<fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
<condition>
<not>
<contains string="${cluster.path.evaluated}" substring="platform"/>
</not>
</condition>
</fail>
<import file="${harness.dir}/build.xml"/>
</project>
8 changes: 8 additions & 0 deletions nbproject/genfiles.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
build.xml.data.CRC32=3b0d48c4
build.xml.script.CRC32=9e80c752
build.xml.stylesheet.CRC32=[email protected]
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=3b0d48c4
nbproject/build-impl.xml.script.CRC32=0e932cb4
nbproject/build-impl.xml.stylesheet.CRC32=[email protected]
12 changes: 12 additions & 0 deletions nbproject/platform.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cluster.path=\
${nbplatform.active.dir}/apisupport:\
${nbplatform.active.dir}/extide:\
${nbplatform.active.dir}/harness:\
${nbplatform.active.dir}/ide:\
${nbplatform.active.dir}/java:\
${nbplatform.active.dir}/javafx:\
${nbplatform.active.dir}/nb:\
${nbplatform.active.dir}/platform:\
${nbplatform.active.dir}/profiler:\
${nbplatform.active.dir}/websvccommon
nbplatform.active=default
5 changes: 5 additions & 0 deletions nbproject/project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
auxiliary.org-netbeans-spi-editor-hints-projects.perProjectHintSettingsFile=nbproject/cfg_hints.xml
javac.source=1.8
javac.compilerargs=-Xlint -Xlint:-serial
nbm.module.author=Tuupertunut
project.license=default
128 changes: 128 additions & 0 deletions nbproject/project.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.apisupport.project</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
<code-name-base>tuupertunut.fxmltemplates</code-name-base>
<standalone/>
<module-dependencies>
<dependency>
<code-name-base>net.java.html</code-name-base>
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<specification-version>1.3.0</specification-version>
</run-dependency>
</dependency>
<dependency>
<code-name-base>net.java.html.json</code-name-base>
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<specification-version>1.3.0</specification-version>
</run-dependency>
</dependency>
<dependency>
<code-name-base>org.netbeans.api.templates</code-name-base>
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<specification-version>1.7.1</specification-version>
</run-dependency>
</dependency>
<dependency>
<code-name-base>org.netbeans.modules.java.project.ui</code-name-base>
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<release-version>1</release-version>
<specification-version>1.69.1</specification-version>
</run-dependency>
</dependency>
<dependency>
<code-name-base>org.netbeans.modules.projectapi</code-name-base>
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<release-version>1</release-version>
<specification-version>1.66.1</specification-version>
</run-dependency>
</dependency>
<dependency>
<code-name-base>org.netbeans.modules.projectuiapi</code-name-base>
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<release-version>1</release-version>
<specification-version>1.88.1.8</specification-version>
</run-dependency>
</dependency>
<dependency>
<code-name-base>org.openide.awt</code-name-base>
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<specification-version>7.67.1</specification-version>
</run-dependency>
</dependency>
<dependency>
<code-name-base>org.openide.dialogs</code-name-base>
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<specification-version>7.42.1</specification-version>
</run-dependency>
</dependency>
<dependency>
<code-name-base>org.openide.filesystems</code-name-base>
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<specification-version>9.10.1</specification-version>
</run-dependency>
</dependency>
<dependency>
<code-name-base>org.openide.loaders</code-name-base>
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<specification-version>7.66.1</specification-version>
</run-dependency>
</dependency>
<dependency>
<code-name-base>org.openide.nodes</code-name-base>
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<specification-version>7.45.1</specification-version>
</run-dependency>
</dependency>
<dependency>
<code-name-base>org.openide.util</code-name-base>
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<specification-version>9.7.1</specification-version>
</run-dependency>
</dependency>
<dependency>
<code-name-base>org.openide.util.lookup</code-name-base>
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<specification-version>8.33.1</specification-version>
</run-dependency>
</dependency>
<dependency>
<code-name-base>org.openide.util.ui</code-name-base>
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<specification-version>9.6.1</specification-version>
</run-dependency>
</dependency>
</module-dependencies>
<public-packages/>
</data>
</configuration>
</project>
103 changes: 103 additions & 0 deletions src/tuupertunut/fxmltemplates/BaseJavaIterator.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/*
* The MIT License
*
* Copyright 2017 Tuupertunut.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package tuupertunut.fxmltemplates;

import java.io.IOException;
import java.util.Set;
import javax.swing.event.ChangeListener;
import org.netbeans.spi.java.project.support.ui.templates.JavaTemplates;
import org.openide.WizardDescriptor;
import org.openide.filesystems.FileObject;

/**
*
* @author Tuupertunut
*/
public class BaseJavaIterator implements WizardDescriptor.InstantiatingIterator<WizardDescriptor> {

protected WizardDescriptor wizard;

private WizardDescriptor.InstantiatingIterator<WizardDescriptor> delegate;

public BaseJavaIterator() {
delegate = JavaTemplates.createJavaTemplateIterator();
}

@Override
public Set<FileObject> instantiate() throws IOException {
return delegate.instantiate();
}

@Override
public void initialize(WizardDescriptor wd) {
wizard = wd;
delegate.initialize(wd);
}

@Override
public void uninitialize(WizardDescriptor wd) {
wizard = null;
delegate.uninitialize(wd);
}

@Override
public WizardDescriptor.Panel<WizardDescriptor> current() {
return delegate.current();
}

@Override
public String name() {
return delegate.name();
}

@Override
public boolean hasNext() {
return delegate.hasNext();
}

@Override
public boolean hasPrevious() {
return delegate.hasPrevious();
}

@Override
public void nextPanel() {
delegate.nextPanel();
}

@Override
public void previousPanel() {
delegate.previousPanel();
}

@Override
public void addChangeListener(ChangeListener cl) {
delegate.addChangeListener(cl);
}

@Override
public void removeChangeListener(ChangeListener cl) {
delegate.removeChangeListener(cl);
}
}
7 changes: 7 additions & 0 deletions src/tuupertunut/fxmltemplates/Bundle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FxmlNode_displayName=JavaFX FXML Node
FxmlApp_displayName=JavaFX FXML Application
OpenIDE-Module-Display-Category=JavaFX 2
OpenIDE-Module-Long-Description=\
Adds templates for creating new JavaFX FXML Nodes and Applications.
OpenIDE-Module-Name=FXML templates
OpenIDE-Module-Short-Description=Adds templates for creating new JavaFX FXML Nodes and Applications.
8 changes: 8 additions & 0 deletions src/tuupertunut/fxmltemplates/FxmlAppDescription.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
Creates new JavaFX application main class and a root Node using FXML.
</body>
</html>
Loading

0 comments on commit b8cedd8

Please sign in to comment.