Package it.tidalwave.ui.javafx
Class JavaFXSafeProxyCreator
- java.lang.Object
-
- it.tidalwave.ui.javafx.JavaFXSafeProxyCreator
-
public class JavaFXSafeProxyCreator extends java.lang.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
-
Field Summary
Fields Modifier and Type Field Description static java.util.Map<java.lang.Class<?>,java.lang.Object>
BEANS
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> JavaFXSafeProxyCreator.NodeAndDelegate
createNodeAndDelegate(java.lang.Class<?> presentationClass)
Creates aJavaFXSafeProxyCreator.NodeAndDelegate
for the given presentation class.static <T> JavaFXSafeProxyCreator.NodeAndDelegate
createNodeAndDelegate(java.lang.Class<?> presentationClass, java.lang.String fxmlResourcePath)
Creates aJavaFXSafeProxyCreator.NodeAndDelegate
for the given presentation class.static <T> T
createSafeProxy(T target, java.lang.Class<T> interfaceClass)
-
-
-
Method Detail
-
createNodeAndDelegate
@Nonnull public static <T> JavaFXSafeProxyCreator.NodeAndDelegate createNodeAndDelegate(@Nonnull java.lang.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 java.lang.Class<?> presentationClass, @Nonnull java.lang.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
-
createSafeProxy
@Nonnull public static <T> T createSafeProxy(@Nonnull T target, java.lang.Class<T> interfaceClass)
-
-