Klasse ViewLoader

java.lang.Object
com.airhacks.afterburner.views.ViewLoader

public class ViewLoader extends Object
  • Felddetails

    • fxmlLoader

      protected javafx.fxml.FXMLLoader fxmlLoader
    • bundleName

      protected String bundleName
    • resource

      protected URL resource
    • FX_PLATFORM_EXECUTOR

      protected static Executor FX_PLATFORM_EXECUTOR
    • PARENT_CREATION_POOL

      protected static final ExecutorService PARENT_CREATION_POOL
    • clazz

      protected final Class<?> clazz
  • Methodendetails

    • view

      public static ViewLoader view(Class<? extends Object> clazz)
      Initialized the ViewLoader to load the given view. The fxml (or other resources) are not yet loaded.
    • view

      public static ViewLoader view(Object root)
      Initialized the ViewLoader to load the given view. The given object is used as the controller. The fxml (or other resources) are not yet loaded.
    • controller

      public ViewLoader controller(Object root)
      Sets the given class as controller. We don't use FXMLLoader.setController(Object) since then the fx:controller attribute is no longer allowed in the fxml file and we loose IDE support.
    • inject

      public ViewLoader inject(Function<String,Object> injectionContext)
      Specifies the injection source used to construct the controller. Values matching for the keys are going to be used for injection into the corresponding controller.
      Parameter:
      injectionContext - the function used as a injection source.
    • root

      public ViewLoader root(Object root)
      Sets the root of the object hierarchy. The value passed to this method is used as the value of the <fx:root> tag. This method must be called prior to loading the document when using <fx:root>.
      Parameter:
      root - the object used as the root
    • load

      Synchronously loads the FXML file and associated resources.
      Gibt zurück:
      a composite object giving access to the loaded root node and initialized controller
      Löst aus:
      IllegalStateException - if an exception occurred during loading and parsing of the FXML file
    • load

      public void load(Consumer<javafx.scene.Parent> consumer)
      Synchronously loads the FXML file and associated resources and invokes the created root node to the given consumer within the FX UI thread.
      Parameter:
      consumer - the callback that receives the loaded root node
    • loadAsync

      public void loadAsync(Consumer<javafx.scene.Parent> consumer)
      Asynchronously loads the FXML file and associated resources using an internal thread pool and invokes the created root node to the given consumer within the FX UI thread.
      Parameter:
      consumer - the callback that receives the loaded root node
    • getConventionalName

      protected String getConventionalName(boolean lowercase, String ending)
      Parameter:
      lowercase - indicates whether the simple class name should be converted to lowercase of left unchanged
      ending - the suffix to append
      Gibt zurück:
      the conventional name with stripped ending
    • getConventionalName

      protected String getConventionalName(boolean lowercase)
      Parameter:
      lowercase - indicates whether the simple class name should be
      Gibt zurück:
      the name of the view without the "View" prefix.
    • exceptionReporter

      public Void exceptionReporter(Throwable t)
      Parameter:
      t - exception to report
      Gibt zurück:
      nothing