Class EntityApplicationView<M extends FXEntityApplicationModel>

    • Constructor Detail

      • EntityApplicationView

        public EntityApplicationView​(String applicationTitle)
        Instantiates a new EntityApplicationView instance.
        Parameters:
        applicationTitle - the title to display in the view header
      • EntityApplicationView

        public EntityApplicationView​(String applicationTitle,
                                     String iconFileName)
        Instantiates a new EntityApplicationView instance.
        Parameters:
        applicationTitle - the title to display in the view header
        iconFileName - the name of an icon file on the classpath to display
    • Method Detail

      • model

        public final M model()
        Returns:
        the application model
      • addEntityView

        public final void addEntityView​(EntityView entityView)
        Adds a EntityView to this application
        Parameters:
        entityView - the EntityView to add
      • start

        public final void start​(javafx.stage.Stage stage)
        Starts this application
        Specified by:
        start in class javafx.application.Application
        Parameters:
        stage - the State on which to set this application
      • initializeConnectionProvider

        protected EntityConnectionProvider initializeConnectionProvider​(User user,
                                                                        String clientTypeId)
        Initializes the connection provider to use in this application
        Parameters:
        user - the user on which to base the connection
        clientTypeId - a String identifying the client type
        Returns:
        a EntityConnectionProvider based on the given user and client type
      • defaultUser

        protected User defaultUser()
        Returns:
        the default user when logging into this application
      • applicationIdentifier

        protected String applicationIdentifier()
        Returns:
        a String identifying this application, the class name by default
      • createMainMenu

        protected javafx.scene.control.MenuBar createMainMenu()
        Returns:
        the main menu for this application
      • showLoginPanel

        protected final User showLoginPanel​(User defaultUser)
        Displays a login panel
        Parameters:
        defaultUser - the default user to display
        Returns:
        the user retrieved from the login panel
        Throws:
        CancelException - in case the login action is cancelled
      • savePreferences

        protected void savePreferences()
        Called on application exit, override to save user preferences on program exit, remember to call super.savePreferences() when overriding
        See Also:
        EntityApplicationModel.savePreferences()
      • createEntityViews

        protected abstract void createEntityViews()
        Initialized all entity views and adds them via addEntityView(EntityView)
      • createApplicationScene

        protected javafx.scene.Scene createApplicationScene​(javafx.stage.Stage primaryStage)
        Creates the application scene from the available EntityViews.
        Parameters:
        primaryStage - the primary stage
        Returns:
        the application scene
      • createApplicationModel

        protected abstract M createApplicationModel​(EntityConnectionProvider connectionProvider)
        Initializes the application model
        Parameters:
        connectionProvider - the connection provider
        Returns:
        the application model