java.lang.Object
de.seggebaeing.sqlanalyzer.presentation.util.ResourceLoader

public class ResourceLoader extends Object
Utility for loading de.seggebaeing.sqlanalyzer.presentation resources from the classpath (icons, help HTML, FXML). Uses the thread context ClassLoader; returns null when unavailable. Stateless and thread-safe.
Since:
1.0
Author:
Felix Seggebäing
  • Constructor Details

    • ResourceLoader

      public ResourceLoader()
  • Method Details

    • loadIcon

      public static javafx.scene.image.Image loadIcon(String fileName)
      Loads an icon image from the classpath under /icon/.
      Parameters:
      fileName - the icon file name (e.g., "app.png"); must not be null
      Returns:
      the loaded Image, or null if the resource cannot be found
      Throws:
      NullPointerException - if fileName is null
    • getHelpHtmlUrl

      public static URL getHelpHtmlUrl(String fileName)
      Resolves a help document URL from the classpath under /help/, appending .html if the extension is missing. Logs a warning when the resource cannot be found.
      Parameters:
      fileName - the help file name (with or without .html); must not be null
      Returns:
      the URL to the resource, or null if unavailable
      Throws:
      NullPointerException - if fileName is null
    • getFxmlUrl

      public static URL getFxmlUrl(String fileName)
      Resolves a URL to an FXML resource under /fxml/, appending .fxml if absent. Uses the thread context ClassLoader.
      Parameters:
      fileName - the FXML file name (with or without .fxml); must not be null
      Returns:
      the URL of the resource, or null if not found
      Throws:
      NullPointerException - if fileName is null