Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2014-01-11 09:28:18 -0500
committerTom Schindl2014-01-11 09:28:18 -0500
commit671647e8acfe1f22f88bcc34fcd5f8fad10dae67 (patch)
tree57e251437c6b0be6c84df4bb0533898cce6aabbd
parent788328aaf933f6c271a186bec84f59bc67224db6 (diff)
downloadorg.eclipse.efxclipse-671647e8acfe1f22f88bcc34fcd5f8fad10dae67.tar.gz
org.eclipse.efxclipse-671647e8acfe1f22f88bcc34fcd5f8fad10dae67.tar.xz
org.eclipse.efxclipse-671647e8acfe1f22f88bcc34fcd5f8fad10dae67.zip
Bug 419107 - Add functionality to easily access the controller instance
using FXMLLoaderFactory
-rwxr-xr-xbundles/runtime/org.eclipse.fx.osgi.util/src/org/eclipse/fx/osgi/util/OSGiFXMLLoader.java169
-rwxr-xr-xbundles/runtime/org.eclipse.fx.ui.di/.settings/org.eclipse.jdt.core.prefs113
-rwxr-xr-xbundles/runtime/org.eclipse.fx.ui.di/src/org/eclipse/fx/ui/di/FXMLBuilder.java6
-rwxr-xr-xbundles/runtime/org.eclipse.fx.ui.di/src/org/eclipse/fx/ui/di/InjectingFXMLLoader.java55
4 files changed, 327 insertions, 16 deletions
diff --git a/bundles/runtime/org.eclipse.fx.osgi.util/src/org/eclipse/fx/osgi/util/OSGiFXMLLoader.java b/bundles/runtime/org.eclipse.fx.osgi.util/src/org/eclipse/fx/osgi/util/OSGiFXMLLoader.java
index 428fbfb3f..fdd3441b8 100755
--- a/bundles/runtime/org.eclipse.fx.osgi.util/src/org/eclipse/fx/osgi/util/OSGiFXMLLoader.java
+++ b/bundles/runtime/org.eclipse.fx.osgi.util/src/org/eclipse/fx/osgi/util/OSGiFXMLLoader.java
@@ -49,6 +49,26 @@ public class OSGiFXMLLoader {
ClassLoader loader = requester.getClassLoader();
return load(loader, url, resourceBundle, builderFactory);
}
+
+ /**
+ * Load a FXML file relative to the requested and provide the constructed scene-node and the controller
+ *
+ * @param requester
+ * the requester
+ * @param relativeFxmlPath
+ * the relative FXML-File Path
+ * @param resourceBundle
+ * the translation to be used
+ * @param builderFactory
+ * the builder factory to use
+ * @return the created scene graph
+ * @throws IOException
+ */
+ public static <O,C> FXMLData<O,C> loadWithController(@NonNull Class<?> requester, @NonNull String relativeFxmlPath, @Nullable ResourceBundle resourceBundle, @Nullable BuilderFactory builderFactory) throws IOException {
+ URL url = requester.getResource(relativeFxmlPath);
+ ClassLoader loader = requester.getClassLoader();
+ return loadWithController(loader, url, resourceBundle, builderFactory);
+ }
/**
* Load a FXML file relative to the bundle
@@ -69,6 +89,26 @@ public class OSGiFXMLLoader {
ClassLoader loader = bundle.adapt(BundleWiring.class).getClassLoader();
return load(loader, url, resourceBundle, builderFactory);
}
+
+ /**
+ * Load a FXML file relative to the bundle and provide the constructed scene-node and the controller
+ *
+ * @param bundle
+ * the bundle
+ * @param bundleRelativeFxmlPath
+ * the bundle relative path
+ * @param resourceBundle
+ * the translation to be used
+ * @param builderFactory
+ * the builder factory to use
+ * @return the created scene graph
+ * @throws IOException
+ */
+ public static <O,C> FXMLData<O,C> loadWithController(@NonNull Bundle bundle, @NonNull String bundleRelativeFxmlPath, @Nullable ResourceBundle resourceBundle, @Nullable BuilderFactory builderFactory) throws IOException {
+ URL url = bundle.getResource(bundleRelativeFxmlPath);
+ ClassLoader loader = bundle.adapt(BundleWiring.class).getClassLoader();
+ return loadWithController(loader, url, resourceBundle, builderFactory);
+ }
/**
* Load using the given classloader
@@ -87,6 +127,24 @@ public class OSGiFXMLLoader {
public static <O> O load(@NonNull ClassLoader classloader, @NonNull URL url, @Nullable ResourceBundle resourceBundle, @Nullable BuilderFactory builderFactory) throws IOException {
return load(classloader, url, resourceBundle, builderFactory, null);
}
+
+ /**
+ * Load using the given classloader and provide the constructed scene-node and the controller
+ *
+ * @param classloader
+ * the classloader
+ * @param url
+ * the url of the fxml file
+ * @param resourceBundle
+ * the translations
+ * @param builderFactory
+ * the builder factory
+ * @return the created scene graph
+ * @throws IOException
+ */
+ public static <O,C> FXMLData<O,C> loadWithController(@NonNull ClassLoader classloader, @NonNull URL url, @Nullable ResourceBundle resourceBundle, @Nullable BuilderFactory builderFactory) throws IOException {
+ return loadWithController(classloader, url, resourceBundle, builderFactory, null);
+ }
/**
* Load a FXML file relative to the requested
@@ -104,12 +162,35 @@ public class OSGiFXMLLoader {
* @return the created scene graph
* @throws IOException
*/
- public static <O> O load(@NonNull Class<?> requester, @NonNull String relativeFxmlPath, @Nullable ResourceBundle resourceBundle, @Nullable BuilderFactory builderFactory, @Nullable Callback<Class<?>, Object> controllerFactory)
- throws IOException {
+ public static <O> O load(@NonNull Class<?> requester, @NonNull String relativeFxmlPath, @Nullable ResourceBundle resourceBundle, @Nullable BuilderFactory builderFactory,
+ @Nullable Callback<Class<?>, Object> controllerFactory) throws IOException {
URL url = requester.getResource(relativeFxmlPath);
ClassLoader loader = requester.getClassLoader();
return load(loader, url, resourceBundle, builderFactory, controllerFactory);
}
+
+ /**
+ * Load a FXML file relative to the requested and provide the constructed scene-node and the controller
+ *
+ * @param requester
+ * the requester
+ * @param relativeFxmlPath
+ * the relative FXML-File Path
+ * @param resourceBundle
+ * the translation to be used
+ * @param builderFactory
+ * the builder factory to use
+ * @param controllerFactory
+ * the controller factory
+ * @return the created scene graph
+ * @throws IOException
+ */
+ public static <O,C> FXMLData<O,C> loadWithController(@NonNull Class<?> requester, @NonNull String relativeFxmlPath, @Nullable ResourceBundle resourceBundle, @Nullable BuilderFactory builderFactory,
+ @Nullable Callback<Class<?>, Object> controllerFactory) throws IOException {
+ URL url = requester.getResource(relativeFxmlPath);
+ ClassLoader loader = requester.getClassLoader();
+ return loadWithController(loader, url, resourceBundle, builderFactory, controllerFactory);
+ }
/**
* Load a FXML file relative to the bundle
@@ -127,12 +208,35 @@ public class OSGiFXMLLoader {
* @return the created scene graph
* @throws IOException
*/
- public static <O> O load(@NonNull Bundle bundle, @NonNull String bundleRelativeFxmlPath, @Nullable ResourceBundle resourceBundle, @Nullable BuilderFactory builderFactory, @Nullable Callback<Class<?>, Object> controllerFactory)
- throws IOException {
+ public static <O> O load(@NonNull Bundle bundle, @NonNull String bundleRelativeFxmlPath, @Nullable ResourceBundle resourceBundle, @Nullable BuilderFactory builderFactory,
+ @Nullable Callback<Class<?>, Object> controllerFactory) throws IOException {
URL url = bundle.getResource(bundleRelativeFxmlPath);
ClassLoader loader = bundle.adapt(BundleWiring.class).getClassLoader();
return load(loader, url, resourceBundle, builderFactory, controllerFactory);
}
+
+ /**
+ * Load a FXML file relative to the bundle and provide the constructed scene-node and the controller
+ *
+ * @param bundle
+ * the bundle
+ * @param bundleRelativeFxmlPath
+ * the bundle relative path
+ * @param resourceBundle
+ * the translation to be used
+ * @param builderFactory
+ * the builder factory to use
+ * @param controllerFactory
+ * the controller factory
+ * @return the created scene graph
+ * @throws IOException
+ */
+ public static <O,C> FXMLData<O,C> loadWithController(@NonNull Bundle bundle, @NonNull String bundleRelativeFxmlPath, @Nullable ResourceBundle resourceBundle, @Nullable BuilderFactory builderFactory,
+ @Nullable Callback<Class<?>, Object> controllerFactory) throws IOException {
+ URL url = bundle.getResource(bundleRelativeFxmlPath);
+ ClassLoader loader = bundle.adapt(BundleWiring.class).getClassLoader();
+ return loadWithController(loader, url, resourceBundle, builderFactory, controllerFactory);
+ }
/**
* Load using the given classloader
@@ -150,9 +254,30 @@ public class OSGiFXMLLoader {
* @return the created scene graph
* @throws IOException
*/
- public static <O> O load(@NonNull final ClassLoader classloader, @NonNull URL url, @Nullable ResourceBundle resourceBundle, @Nullable final BuilderFactory builderFactory, @Nullable Callback<Class<?>, Object> controllerFactory)
- throws IOException {
+ public static <O> O load(@NonNull final ClassLoader classloader, @NonNull URL url, @Nullable ResourceBundle resourceBundle, @Nullable final BuilderFactory builderFactory,
+ @Nullable Callback<Class<?>, Object> controllerFactory) throws IOException {
+ return OSGiFXMLLoader.<O, Object> loadWithController(classloader, url, resourceBundle, builderFactory, controllerFactory).node;
+ }
+ /**
+ * Load using the given classloader and provide the constructed scene-node and the controller
+ *
+ * @param classloader
+ * the classloader
+ * @param url
+ * the url of the fxml file
+ * @param resourceBundle
+ * the translations
+ * @param builderFactory
+ * the builder factory
+ * @param controllerFactory
+ * the controller factory
+ * @return the created scene graph
+ * @throws IOException
+ */
+ @SuppressWarnings("unchecked")
+ public static <O, C> FXMLData<O, C> loadWithController(@NonNull final ClassLoader classloader, @NonNull URL url, @Nullable ResourceBundle resourceBundle,
+ @Nullable final BuilderFactory builderFactory, @Nullable Callback<Class<?>, Object> controllerFactory) throws IOException {
FXMLLoader loader = new FXMLLoader();
loader.setLocation(url);
loader.setClassLoader(classloader);
@@ -178,11 +303,35 @@ public class OSGiFXMLLoader {
loader.setControllerFactory(controllerFactory);
}
- try( InputStream in = url.openStream() ) {
- @SuppressWarnings("unchecked")
- O value = (O) loader.load(in);
+ try (InputStream in = url.openStream()) {
+ O value = loader.load(in);
in.close();
- return value;
+ return new FXMLData<O, C>(value, (C) loader.getController());
+ }
+ }
+
+ /**
+ * Data structured holding data constructed while loading the FXML-Document
+ *
+ * @param <N> the node
+ * @param <C> the controller
+ */
+ public static class FXMLData<N, C> {
+ /**
+ * The node
+ */
+ @NonNull
+ public final N node;
+
+ /**
+ * The controller, might be <code>null</code>
+ */
+ @Nullable
+ public final C controller;
+
+ FXMLData(N node, C controller) {
+ this.node = node;
+ this.controller = controller;
}
}
}
diff --git a/bundles/runtime/org.eclipse.fx.ui.di/.settings/org.eclipse.jdt.core.prefs b/bundles/runtime/org.eclipse.fx.ui.di/.settings/org.eclipse.jdt.core.prefs
index f42de363a..5671530f4 100755
--- a/bundles/runtime/org.eclipse.fx.ui.di/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/runtime/org.eclipse.fx.ui.di/.settings/org.eclipse.jdt.core.prefs
@@ -1,7 +1,114 @@
eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
-org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=warning
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.7
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=error
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=warning
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/bundles/runtime/org.eclipse.fx.ui.di/src/org/eclipse/fx/ui/di/FXMLBuilder.java b/bundles/runtime/org.eclipse.fx.ui.di/src/org/eclipse/fx/ui/di/FXMLBuilder.java
index 59b9a4718..8fa9585f3 100755
--- a/bundles/runtime/org.eclipse.fx.ui.di/src/org/eclipse/fx/ui/di/FXMLBuilder.java
+++ b/bundles/runtime/org.eclipse.fx.ui.di/src/org/eclipse/fx/ui/di/FXMLBuilder.java
@@ -19,4 +19,10 @@ public interface FXMLBuilder<N> {
FXMLBuilder<N> resourceBundle(ResourceBundle resourceBundle);
FXMLBuilder<N> builderFactory(BuilderFactory builderFactory);
N load() throws IOException;
+ <C> Data loadWithController() throws IOException;
+
+ interface Data<N,C> {
+ public N getNode();
+ public C getController();
+ }
}
diff --git a/bundles/runtime/org.eclipse.fx.ui.di/src/org/eclipse/fx/ui/di/InjectingFXMLLoader.java b/bundles/runtime/org.eclipse.fx.ui.di/src/org/eclipse/fx/ui/di/InjectingFXMLLoader.java
index 4fc0b0911..a680bd58e 100755
--- a/bundles/runtime/org.eclipse.fx.ui.di/src/org/eclipse/fx/ui/di/InjectingFXMLLoader.java
+++ b/bundles/runtime/org.eclipse.fx.ui.di/src/org/eclipse/fx/ui/di/InjectingFXMLLoader.java
@@ -21,6 +21,7 @@ import javafx.util.Callback;
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.fx.osgi.util.OSGiFXMLLoader;
+import org.eclipse.fx.osgi.util.OSGiFXMLLoader.FXMLData;
import org.osgi.framework.Bundle;
@@ -31,30 +32,78 @@ public abstract class InjectingFXMLLoader<N> implements FXMLBuilder<N> {
public static <N> InjectingFXMLLoader<N> create(final IEclipseContext context, final Class<?> requester, final String relativeFxmlPath) {
return new InjectingFXMLLoader<N>() {
+ @Override
public N load() throws IOException {
- return OSGiFXMLLoader.load(requester, relativeFxmlPath, resourceBundle, builderFactory, new ControllerFactory(context));
+ return OSGiFXMLLoader.load(requester, relativeFxmlPath, this.resourceBundle, this.builderFactory, new ControllerFactory(context));
}
+ @Override
+ public <C> Data<N,C> loadWithController() throws IOException {
+ FXMLData<N, C> d = OSGiFXMLLoader.loadWithController(requester, relativeFxmlPath, this.resourceBundle, this.builderFactory, new ControllerFactory(context));
+ return new Data<N, C>() {
+ @Override
+ public C getController() {
+ return d.controller;
+ }
+
+ @Override
+ public N getNode() {
+ return d.node;
+ }
+ };
+ }
};
}
public static <N> InjectingFXMLLoader<N> create(final IEclipseContext context, final Bundle bundle, final String bundleRelativeFxmlPath) {
return new InjectingFXMLLoader<N>() {
+ @Override
public N load() throws IOException {
- return OSGiFXMLLoader.load(bundle, bundleRelativeFxmlPath, resourceBundle, builderFactory, new ControllerFactory(context));
+ return OSGiFXMLLoader.load(bundle, bundleRelativeFxmlPath, this.resourceBundle, this.builderFactory, new ControllerFactory(context));
}
+ @Override
+ public <C> Data<N,C> loadWithController() throws IOException {
+ FXMLData<N, C> d = OSGiFXMLLoader.loadWithController(bundle, bundleRelativeFxmlPath, this.resourceBundle, this.builderFactory, new ControllerFactory(context));
+ return new Data<N, C>() {
+ @Override
+ public C getController() {
+ return d.controller;
+ }
+
+ @Override
+ public N getNode() {
+ return d.node;
+ }
+ };
+ }
};
}
public static <N> InjectingFXMLLoader<N> create(final IEclipseContext context, final ClassLoader classloader, final URL url) {
return new InjectingFXMLLoader<N>() {
+ @Override
public N load() throws IOException {
- return OSGiFXMLLoader.load(classloader, url, resourceBundle, builderFactory, new ControllerFactory(context));
+ return OSGiFXMLLoader.load(classloader, url, this.resourceBundle, this.builderFactory, new ControllerFactory(context));
}
+ @Override
+ public <C> Data<N,C> loadWithController() throws IOException {
+ FXMLData<N, C> d = OSGiFXMLLoader.loadWithController(classloader, url, this.resourceBundle, this.builderFactory, new ControllerFactory(context));
+ return new Data<N, C>() {
+ @Override
+ public C getController() {
+ return d.controller;
+ }
+
+ @Override
+ public N getNode() {
+ return d.node;
+ }
+ };
+ }
};
}

Back to the top