Package org.fulib.fx.util
Class ReflectionUtil
java.lang.Object
org.fulib.fx.util.ReflectionUtil
Utility class containing different helper methods for the framework or the user.
Parts of this class are hacky and should be used with caution.
-
Method Summary
Modifier and TypeMethodDescriptionstatic javafx.collections.ObservableList<javafx.scene.Node>getChildrenList(Class<?> clazz, javafx.scene.Parent parent) Returns the children list of the given parent.static ObjectgetInstanceOfProviderField(Field provider, Object instance) Returns an instance provided by the given provider field.static @Nullable Class<?>getProvidedClass(@NotNull Field providerField) Returns the class provided by the given provider field.static voidresetMouseHandler(javafx.stage.Stage stage) Resets the mouse handler of the given stage.
-
Method Details
-
getProvidedClass
Returns the class provided by the given provider field.- Parameters:
providerField- The provider field- Returns:
- The class provided by the provider field or null if the field is not a valid provider field
-
getChildrenList
public static javafx.collections.ObservableList<javafx.scene.Node> getChildrenList(Class<?> clazz, javafx.scene.Parent parent) Returns the children list of the given parent. This method is used to access the children list of a Parent class even though the method is not public in the Parent class. This should be used with caution and is mainly used for duplicating nodes.- Parameters:
clazz- The class to get the children list fromparent- The parent to get the children list from- Returns:
- The children list of the given parent
-
getInstanceOfProviderField
Returns an instance provided by the given provider field.- Parameters:
provider- The provider fieldinstance- The instance to get the provider from- Returns:
- The instance provided by the provider field
-
resetMouseHandler
public static void resetMouseHandler(javafx.stage.Stage stage) Resets the mouse handler of the given stage. This method is used to reset the mouse handler of a scene to avoid problems with mouse drag events. This should be used with caution and is mainly used for refreshing the scene.- Parameters:
stage- The stage to reset the mouse handler for
-