Package it.tidalwave.ui.javafx
Class JavaFXSafeProxyCreator
- java.lang.Object
-
- it.tidalwave.ui.javafx.JavaFXSafeProxyCreator
-
public class JavaFXSafeProxyCreator extends Object
This facility class create a thread-safe proxy for the JavaFX delegate (controller). Thread-safe means that it can be called by any thread and the JavaFX UI related stuff will be safely invoked in the JavaFX UI Thread. It is usually used in this way:// This is a Spring bean public class JavaFxFooBarPresentation implements FooBarPresentation { private static final String FXML_URL = "/my/package/javafx/FooBar.fxml";
- Author:
- Fabrizio Giudici
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JavaFXSafeProxyCreator.NodeAndDelegate
-
Constructor Summary
Constructors Constructor Description JavaFXSafeProxyCreator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> JavaFXSafeProxyCreator.NodeAndDelegate
createNodeAndDelegate(Class<?> presentationClass)
Creates aJavaFXSafeProxyCreator.NodeAndDelegate
for the given presentation class.static <T> JavaFXSafeProxyCreator.NodeAndDelegate
createNodeAndDelegate(Class<?> presentationClass, String fxmlResourcePath)
Creates aJavaFXSafeProxyCreator.NodeAndDelegate
for the given presentation class.static <T> T
createSafeProxy(T target, Class<T> interfaceClass)
-
-
-
Method Detail
-
createNodeAndDelegate
@Nonnull public static <T> JavaFXSafeProxyCreator.NodeAndDelegate createNodeAndDelegate(@Nonnull Class<?> presentationClass)
Creates aJavaFXSafeProxyCreator.NodeAndDelegate
for the given presentation class. The FXML resource name is inferred by default, For instance, is the class is namedJavaFXFooBarPresentation
, the resource name isFooBar.fxml
and searched in the same packages as the class.- Parameters:
presentationClass
- the class of the presentation for which the resources must be created.- Since:
- 1.0-ALPHA-13
- See Also:
createNodeAndDelegate(java.lang.Class, java.lang.String)
-
createNodeAndDelegate
@Nonnull public static <T> JavaFXSafeProxyCreator.NodeAndDelegate createNodeAndDelegate(@Nonnull Class<?> presentationClass, @Nonnull String fxmlResourcePath)
Creates aJavaFXSafeProxyCreator.NodeAndDelegate
for the given presentation class.- Parameters:
presentationClass
- the class of the presentation for which the resources must be created.fxmlResourcePath
- the path of the FXML resource
-
-