C - the main controller typepublic abstract class DesktopApplication<C extends FxController> extends AbstractApplication
| Constructor and Description |
|---|
DesktopApplication(String name)
Creates an FX desktop application.
|
| Modifier and Type | Method and Description |
|---|---|
void |
configureMainStage(javafx.stage.Stage mainStage)
Configures and sets the main stage.
|
protected void |
configureModificationTracker() |
protected void |
configurePreferences()
Installs the preferences backend.
The option "systemprefs" forces usage of system preferences only. |
protected void |
configureSecurityManager() |
DomainContext |
createDomainContext(org.tentackle.session.Session session) |
LoginFailedHandler |
createLoginFailedHandler(javafx.scene.Parent view,
org.tentackle.session.SessionInfo sessionInfo)
Creates the login failed handler.
|
protected void |
doFinishStartup()
Finishes the startup.
Invoked after all has been displayed. |
void |
doLogin(javafx.scene.Parent view,
org.tentackle.session.SessionInfo sessionInfo)
Performs the login and final startup of the application.
|
protected void |
doStop(int exitValue)
Terminates the application gracefully.
|
protected void |
doStop(int exitValue,
Exception ex)
Terminates the application gracefully.
|
Class<? extends FxApplication> |
getApplicationClass()
Gets the FX application class.
|
org.tentackle.misc.CommandLine |
getCommandLine()
Gets the command line.
|
static DesktopApplication<?> |
getDesktopApplication()
Gets the running desktop application.
|
FxApplication |
getFxApplication()
Gets the FX application instance.
This is the instance of the class provided by getApplicationClass().The FX-application ususally provides a login-view and is responsible to spawn the main view after successful login. |
C |
getMainController()
Gets the main controller.
|
abstract Class<? extends C> |
getMainControllerClass()
Gets the main-controller to be displayed initially.
Maintains the main-scene of the application. |
javafx.stage.Stage |
getMainStage()
Gets the main stage.
|
Thread.UncaughtExceptionHandler |
getUncaughtExceptionHandler()
Gets the exception handler.
|
boolean |
isServer() |
void |
registerUncaughtExceptionHandler()
Registers a handler for uncaught exceptions.
|
void |
setFxApplication(FxApplication fxApplication)
Sets the FX application instance.
|
void |
setMainController(C mainController)
Sets the main controller instance.
|
void |
showApplicationStatus(String msg,
double progress)
Displays a message during login.
|
void |
start(String[] args)
Launches the application.
|
void |
stop()
Gracefully terminates the application.
|
createSession, createSessionInfo, deregisterJdbcDrivers, detectContainer, detectJNLP, doConfigureApplication, doInitialize, getCreationTime, getDomainContext, getName, getProperties, getProperty, getRunningApplication, getSession, getSessionInfo, getUser, getUser, isDeployedByJNLP, isRunningInContainer, logStackdump, register, setDomainContext, setName, setProperties, setSessionInfo, toString, unregister, updateSessionInfoAfterLoginclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waiton, oppublic DesktopApplication(String name)
name - the application namepublic static DesktopApplication<?> getDesktopApplication()
public abstract Class<? extends C> getMainControllerClass()
public void configureMainStage(javafx.stage.Stage mainStage)
If overridden, make sure to invoke super.configureMainStage!
mainStage - the main stagepublic javafx.stage.Stage getMainStage()
public void setMainController(C mainController)
mainController - the main controllerpublic C getMainController()
public LoginFailedHandler createLoginFailedHandler(javafx.scene.Parent view, org.tentackle.session.SessionInfo sessionInfo)
view - the viewsessionInfo - the session infopublic void doLogin(javafx.scene.Parent view,
org.tentackle.session.SessionInfo sessionInfo)
The method must hide the view when the main application windows is displayed after successful login.
Notice that this method is invoked from within the FX thread.
view - the view to hide if login succeeded and application window visiblesessionInfo - the session infopublic FxApplication getFxApplication()
getApplicationClass().public void setFxApplication(FxApplication fxApplication)
fxApplication - the FX applicationpublic Class<? extends FxApplication> getApplicationClass()
public void showApplicationStatus(String msg, double progress)
msg - the status messageprogress - the progress, 0 to disable, negative if infinite, 1.0 if donepublic void registerUncaughtExceptionHandler()
public Thread.UncaughtExceptionHandler getUncaughtExceptionHandler()
public boolean isServer()
isServer in class AbstractApplicationpublic DomainContext createDomainContext(org.tentackle.session.Session session)
Overridden to create a DomainContext with a thread-local session.
In deskop client apps there are 2 threads using their own session:
createDomainContext in class AbstractApplicationpublic void start(String[] args)
args - the arguments (usually from commandline)public void stop()
public org.tentackle.misc.CommandLine getCommandLine()
protected void configurePreferences()
"systemprefs" forces usage of system preferences only.configurePreferences in class AbstractApplicationprotected void configureSecurityManager()
configureSecurityManager in class AbstractApplicationprotected void configureModificationTracker()
configureModificationTracker in class AbstractApplicationprotected void doFinishStartup()
throws org.tentackle.misc.ApplicationException
"--nomodthread" given.doFinishStartup in class AbstractApplicationorg.tentackle.misc.ApplicationException - if failedprotected void doStop(int exitValue,
Exception ex)
exitValue - the doStop value for System.exit()ex - an exception causing the termination, null if noneprotected void doStop(int exitValue)
exitValue - the doStop value for System.exit()Tentackle - distributed, domain- and model-driven