Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2014-04-04 16:21:43 +0000
committerTom Schindl2014-04-04 16:21:43 +0000
commit2ffb91879afe95ce7d452320573dfffb6b5f6a81 (patch)
tree618034cea5e90416239cad809c181ee28190b417
parent027363401efa9723c9f91a6922131593c6cb13d9 (diff)
downloadorg.eclipse.efxclipse-2ffb91879afe95ce7d452320573dfffb6b5f6a81.tar.gz
org.eclipse.efxclipse-2ffb91879afe95ce7d452320573dfffb6b5f6a81.tar.xz
org.eclipse.efxclipse-2ffb91879afe95ce7d452320573dfffb6b5f6a81.zip
fixed API
-rw-r--r--bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/fxml/ExtendedFXMLLoader.java17
1 files changed, 8 insertions, 9 deletions
diff --git a/bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/fxml/ExtendedFXMLLoader.java b/bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/fxml/ExtendedFXMLLoader.java
index b8cba29c5..2380c7a51 100644
--- a/bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/fxml/ExtendedFXMLLoader.java
+++ b/bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/fxml/ExtendedFXMLLoader.java
@@ -14,15 +14,14 @@ import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;
-import org.eclipse.fx.core.fxml.FXMLDocument.LoadData;
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.jdt.annotation.Nullable;
-
import javafx.fxml.FXMLLoader;
import javafx.fxml.JavaFXBuilderFactory;
-import javafx.scene.Node;
import javafx.util.Callback;
+import org.eclipse.fx.core.fxml.FXMLDocument.LoadData;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
+
/**
* The extended fxml loader tries to create an instance of a class with the same
* FQN as the given FXML-File and falls back to use the {@link FXMLLoader} if
@@ -85,10 +84,10 @@ public class ExtendedFXMLLoader {
*/
@NonNull
public static <T> T load(@NonNull ClassLoader cl,
- @Nullable ResourceBundle resourceBundle, Node root, @NonNull String path)
+ @Nullable ResourceBundle resourceBundle, T root, @NonNull String path)
throws IOException {
return ExtendedFXMLLoader.<T, Object> loadWithController(cl,
- resourceBundle, null, path).getNode();
+ resourceBundle, root, null, path).getNode();
}
/**
@@ -131,7 +130,7 @@ public class ExtendedFXMLLoader {
@SuppressWarnings("unchecked")
@NonNull
public static <N, C> Data<N, C> loadWithController(@NonNull ClassLoader cl,
- @Nullable ResourceBundle resourceBundle, @Nullable Node root,
+ @Nullable ResourceBundle resourceBundle, @Nullable N root,
@Nullable Callback<Class<?>, Object> controllerFactory,
@NonNull String path) throws IOException {
try {
@@ -141,7 +140,7 @@ public class ExtendedFXMLLoader {
final FXMLDocument<N> d = (FXMLDocument<N>) clazz.newInstance();
URL url = cl.getResource(path);
if (url != null) {
- final N n = d.load(new LoadData(url, resourceBundle,
+ final N n = d.load(new LoadData<N>(url, resourceBundle,
root,controllerFactory));
return new Data<N, C>() {

Back to the top