Interface NodeUtils


public interface NodeUtils
Utility class for working with nodes.
Author:
Besmir Beqiri, Indrit Beqiri
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Object
     
    static final Object
     
  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    static <T extends javafx.event.Event>
    void
    addEventHandler(javafx.scene.Node node, javafx.event.EventType<T> eventType, javafx.event.EventHandler<? super T> eventHandler)
    Adds an event handler to the specified node for the given event type.
    static <K, V> V
    getPropertyValue(javafx.scene.Node node, K key, V defaultValue)
    Retrieves the value of a property associated with the given key from a node.
  • Field Details

    • MULTI_FILE_UPLOADER_KEY

      static final Object MULTI_FILE_UPLOADER_KEY
    • EVENT_HANDLER_KEY

      static final Object EVENT_HANDLER_KEY
  • Method Details

    • getPropertyValue

      static <K, V> V getPropertyValue(javafx.scene.Node node, K key, V defaultValue)
      Retrieves the value of a property associated with the given key from a node.
      Type Parameters:
      K - the type of the key
      V - the type of the value
      Parameters:
      node - the node to retrieve the property value from
      key - the key of the property to retrieve
      defaultValue - the default value to return if the property does not exist
      Returns:
      the value of the property associated with the given key, or the default value if the property does not exist
    • addEventHandler

      static <T extends javafx.event.Event> void addEventHandler(javafx.scene.Node node, javafx.event.EventType<T> eventType, javafx.event.EventHandler<? super T> eventHandler)
      Adds an event handler to the specified node for the given event type. If an event handler for the event type is already added, it will not add another one.
      Type Parameters:
      T - the type of the event
      Parameters:
      node - the node to which the event handler will be added
      eventType - the type of the event to handle
      eventHandler - the event handler to be added