Package org.contextfx.components.views
Class Manager
- java.lang.Object
-
- org.contextfx.components.views.Manager
-
- Direct Known Subclasses:
ReactiveManager
public class Manager extends Object
This class manage the view components- Version:
- 1.0.0
- Author:
- Ramon Rangel Osorio <ramon.rangel@protonmail.com>
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ManagergetManager()Returns the Manager object.static ManagergetManager(Map<Class<?>,Map<String,Object>> components)Generates a function comment for the given function body.javafx.stage.StagegetStage()Retrieves the stage object.voidinit(javafx.stage.Stage stage, Class<? extends javafx.application.Application> application)Initializes the stage, loads the specified application, and switches to the main view.protected voidload(Class<? extends javafx.application.Application> application)Loads the given application class by loading its views.protected FileloadAppConfig(String root)A protected method that loads the application configuration file.protected List<javafx.scene.Parent>loadFxml(Class<? extends javafx.application.Application> application)Load FXML files for the given Java application class.protected voidloadViews(Class<? extends javafx.application.Application> application)Loads views for the given application class.voidsetStage(javafx.stage.Stage stage)Sets the stage of the object.voidswitchSyncView(String name)Switches to the specified sync view.voidswitchView(String name)Switches the view to the specified name.
-
-
-
Method Detail
-
getManager
public static final Manager getManager()
Returns the Manager object.- Returns:
- the Manager object
-
getManager
public static final Manager getManager(Map<Class<?>,Map<String,Object>> components)
Generates a function comment for the given function body.- Parameters:
components- a map containing components- Returns:
- the Manager instance
-
init
public void init(javafx.stage.Stage stage, Class<? extends javafx.application.Application> application)Initializes the stage, loads the specified application, and switches to the main view.- Parameters:
stage- the stage to initializeapplication- the application class to load
-
switchView
public final void switchView(String name)
Switches the view to the specified name.- Parameters:
name- the name of the view to switch to
-
switchSyncView
public final void switchSyncView(String name)
Switches to the specified sync view.- Parameters:
name- the name of the sync view to switch to
-
load
protected void load(Class<? extends javafx.application.Application> application)
Loads the given application class by loading its views. If the views cannot be loaded, a RuntimeException is thrown.- Parameters:
application- the class of the application to load
-
loadViews
protected void loadViews(Class<? extends javafx.application.Application> application)
Loads views for the given application class.- Parameters:
application- the application class to load views for
-
setStage
public void setStage(javafx.stage.Stage stage)
Sets the stage of the object.- Parameters:
stage- the stage to set
-
getStage
public javafx.stage.Stage getStage()
Retrieves the stage object.- Returns:
- the stage object if it is not null, otherwise a new stage object
-
loadAppConfig
protected final File loadAppConfig(String root)
A protected method that loads the application configuration file.- Parameters:
root- the root directory of the application- Returns:
- a File object representing the loaded application configuration file
-
-