M
- the type of FXEntityApplicationModel
used by this application viewpublic abstract class EntityApplicationView<M extends FXEntityApplicationModel> extends javafx.application.Application implements ViewTreeNode<EntityView>
Constructor and Description |
---|
EntityApplicationView(String applicationTitle)
Instantiates a new
EntityApplicationView instance. |
EntityApplicationView(String applicationTitle,
String iconFileName)
Instantiates a new
EntityApplicationView instance. |
Modifier and Type | Method and Description |
---|---|
void |
addEntityView(EntityView entityView)
Adds a
EntityView to this application |
protected String |
applicationIdentifier() |
List<EntityView> |
childViews() |
protected abstract M |
createApplicationModel(EntityConnectionProvider connectionProvider)
Initializes the application model
|
protected javafx.scene.Scene |
createApplicationScene(javafx.stage.Stage primaryStage)
Creates the application scene from the available
EntityView s. |
protected abstract void |
createEntityViews()
Initialized all entity views and adds them via
addEntityView(EntityView) |
protected javafx.scene.control.MenuBar |
createMainMenu() |
protected User |
defaultUser() |
protected EntityConnectionProvider |
initializeConnectionProvider(User user,
String clientTypeId)
Initializes the connection provider to use in this application
|
protected User |
loginUser()
Displays a login panel in case authentication is required, otherwise returns the default user.
|
M |
model() |
Optional<EntityView> |
nextSiblingView() |
Optional<ViewTreeNode<EntityView>> |
parentView() |
Optional<EntityView> |
previousSiblingView() |
protected void |
savePreferences()
Called on application exit, override to save user preferences on program exit,
remember to call super.savePreferences() when overriding
|
protected User |
showLoginPanel(User defaultUser)
Displays a login panel
|
void |
start(javafx.stage.Stage stage)
Starts this application
|
public EntityApplicationView(String applicationTitle)
EntityApplicationView
instance.applicationTitle
- the title to display in the view headerpublic EntityApplicationView(String applicationTitle, String iconFileName)
EntityApplicationView
instance.applicationTitle
- the title to display in the view headericonFileName
- the name of an icon file on the classpath to displaypublic final M model()
public final void addEntityView(EntityView entityView)
EntityView
to this applicationentityView
- the EntityView
to addpublic final Optional<ViewTreeNode<EntityView>> parentView()
parentView
in interface ViewTreeNode<EntityView>
EntityApplicationView
does not have a parent viewpublic final Optional<EntityView> previousSiblingView()
previousSiblingView
in interface ViewTreeNode<EntityView>
EntityApplicationView
does not have a previous sibling viewpublic final Optional<EntityView> nextSiblingView()
nextSiblingView
in interface ViewTreeNode<EntityView>
EntityApplicationView
does not have a next sibling viewpublic final List<EntityView> childViews()
childViews
in interface ViewTreeNode<EntityView>
EntityView
s associated with this applicationaddEntityView(EntityView)
public final void start(javafx.stage.Stage stage)
start
in class javafx.application.Application
stage
- the State on which to set this applicationprotected EntityConnectionProvider initializeConnectionProvider(User user, String clientTypeId)
user
- the user on which to base the connectionclientTypeId
- a String identifying the client typeEntityConnectionProvider
based on the given user and client typeprotected User defaultUser()
protected String applicationIdentifier()
protected javafx.scene.control.MenuBar createMainMenu()
protected final User loginUser()
EntityApplicationModel.AUTHENTICATION_REQUIRED
,
defaultUser()
protected final User showLoginPanel(User defaultUser)
defaultUser
- the default user to displayCancelException
- in case the login action is cancelledprotected void savePreferences()
EntityApplicationModel.savePreferences()
protected abstract void createEntityViews()
addEntityView(EntityView)
protected javafx.scene.Scene createApplicationScene(javafx.stage.Stage primaryStage)
EntityView
s.primaryStage
- the primary stageprotected abstract M createApplicationModel(EntityConnectionProvider connectionProvider)
connectionProvider
- the connection provider