Class Modals

java.lang.Object
org.fulib.fx.controller.Modals

public class Modals extends Object
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Slightly modified version of Stage that destroys the controller when the stage is hidden.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <Display extends javafx.scene.Parent>
    void
    showModal(FulibFxApp app, Display component)
    Shows a controller as a modal window.
    static <Display extends javafx.scene.Parent>
    void
    showModal(FulibFxApp app, Display component, BiConsumer<javafx.stage.Stage,Display> initializer)
    Shows a component as a modal window.
    static <Display extends javafx.scene.Parent>
    void
    showModal(FulibFxApp app, Display component, BiConsumer<javafx.stage.Stage,Display> initializer, Map<String,Object> params, boolean destroyOnClose)
    Shows a controller as a modal window.
    static <Display extends javafx.scene.Parent>
    void
    showModal(FulibFxApp app, Display component, Map<String,Object> params)
    Shows a controller as a modal window.
    static <Display extends javafx.scene.Parent>
    void
    showModal(FulibFxApp app, javafx.stage.Stage currentStage, Display component)
    Shows a controller as a modal window.
    static <Display extends javafx.scene.Parent>
    void
    showModal(FulibFxApp app, javafx.stage.Stage currentStage, Display component, BiConsumer<javafx.stage.Stage,Display> initializer)
    Shows a component as a modal window.
    static <Display extends javafx.scene.Parent>
    void
    showModal(FulibFxApp app, javafx.stage.Stage currentStage, Display component, BiConsumer<javafx.stage.Stage,Display> initializer, Map<String,Object> params, boolean destroyOnClose)
    Shows a controller as a modal window.
    static <Display extends javafx.scene.Parent>
    void
    showModal(FulibFxApp app, javafx.stage.Stage currentStage, Display component, Map<String,Object> params)
    Shows a controller as a modal window.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • showModal

      public static <Display extends javafx.scene.Parent> void showModal(FulibFxApp app, javafx.stage.Stage currentStage, Display component, BiConsumer<javafx.stage.Stage,Display> initializer)
      Shows a component as a modal window.

      Important: The component shouldn't be initialized/rendered before calling this method.

      When closing the window, the component will be destroyed.

      Warning: If the Window.setOnCloseRequest(EventHandler) method is overridden, the controller will not be destroyed automatically.

      Type Parameters:
      Display - the type of the controller
      Parameters:
      app - the app instance
      currentStage - the current stage (see FulibFxApp.stage()
      component - The controller to show
      initializer - the initializer for passing more arguments to the stage and controller
    • showModal

      public static <Display extends javafx.scene.Parent> void showModal(FulibFxApp app, Display component, BiConsumer<javafx.stage.Stage,Display> initializer)
      Shows a component as a modal window.

      Important: The component shouldn't be initialized/rendered before calling this method.

      When closing the window, the component will be destroyed.

      Warning: If the Window.setOnCloseRequest(EventHandler) method is overridden, the controller will not be destroyed automatically.

      Type Parameters:
      Display - the type of the controller
      Parameters:
      app - the app instance
      component - The controller to show
      initializer - the initializer for passing more arguments to the stage and controller
    • showModal

      public static <Display extends javafx.scene.Parent> void showModal(FulibFxApp app, javafx.stage.Stage currentStage, Display component, Map<String,Object> params)
      Shows a controller as a modal window.

      Important: The component shouldn't be initialized/rendered before calling this method.

      When closing the window, the controller will be destroyed. If the Window.setOnCloseRequest(EventHandler) method is overridden, the controller will not be destroyed automatically.

      Type Parameters:
      Display - the type of the controller
      Parameters:
      app - the app instance
      currentStage - the current stage
      component - the class of the controller to show
      params - the parameters to pass to the controller
    • showModal

      public static <Display extends javafx.scene.Parent> void showModal(FulibFxApp app, Display component, Map<String,Object> params)
      Shows a controller as a modal window.

      Important: The component shouldn't be initialized/rendered before calling this method.

      When closing the window, the controller will be destroyed. If the Window.setOnCloseRequest(EventHandler) method is overridden, the controller will not be destroyed automatically.

      Type Parameters:
      Display - the type of the controller
      Parameters:
      app - the app instance
      component - the class of the controller to show
      params - the parameters to pass to the controller
    • showModal

      public static <Display extends javafx.scene.Parent> void showModal(FulibFxApp app, javafx.stage.Stage currentStage, Display component)
      Shows a controller as a modal window.

      Important: The component shouldn't be initialized/rendered before calling this method.

      When closing the window, the controller will be destroyed. If the Window.setOnCloseRequest(EventHandler) method is overridden, the controller will not be destroyed automatically.

      Type Parameters:
      Display - the type of the controller
      Parameters:
      app - the app instance
      currentStage - the current stage
      component - the class of the controller to show
    • showModal

      public static <Display extends javafx.scene.Parent> void showModal(FulibFxApp app, Display component)
      Shows a controller as a modal window.

      Important: The component shouldn't be initialized/rendered before calling this method.

      When closing the window, the controller will be destroyed. If the Window.setOnCloseRequest(EventHandler) method is overridden, the controller will not be destroyed automatically.

      Type Parameters:
      Display - the type of the controller
      Parameters:
      app - the app instance
      component - the class of the controller to show
    • showModal

      public static <Display extends javafx.scene.Parent> void showModal(FulibFxApp app, Display component, BiConsumer<javafx.stage.Stage,Display> initializer, Map<String,Object> params, boolean destroyOnClose)
      Shows a controller as a modal window.

      Important: The component shouldn't be initialized/rendered before calling this method.

      If destroyOnClose is enabled, when closing (or to be more exact, hiding) the window, the controller will be destroyed. The controller will be destroyed before the stage is hidden.

      Type Parameters:
      Display - the type of the controller
      Parameters:
      app - the app instance
      component - the class of the controller to show
      initializer - the initializer for passing more arguments to the stage and controller
      params - the parameters to pass to the controller
      destroyOnClose - if the controller should be destroyed when the window is closed
    • showModal

      public static <Display extends javafx.scene.Parent> void showModal(FulibFxApp app, javafx.stage.Stage currentStage, Display component, BiConsumer<javafx.stage.Stage,Display> initializer, Map<String,Object> params, boolean destroyOnClose)
      Shows a controller as a modal window.

      Important: The component shouldn't be initialized/rendered before calling this method.

      If destroyOnClose is enabled, when closing (or to be more exact, hiding) the window, the controller will be destroyed. The controller will be destroyed before the stage is hidden.

      Type Parameters:
      Display - the type of the controller
      Parameters:
      app - the app instance
      currentStage - the current stage
      component - the class of the controller to show
      initializer - the initializer for passing more arguments to the stage and controller
      params - the parameters to pass to the controller