public abstract class AbstractJFXApplication extends javafx.application.Application implements MDIApplication, PluginsListener, CommandLineListener
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.String,AppliManifestType> |
additionalPluginTypes
The additional Plugins Types, optional property.
|
protected java.util.Map<java.lang.String,java.lang.Boolean> |
allowedPluginTypes
The allowed Plugins Types, optional property.
|
protected java.util.Map<java.lang.String,java.lang.String> |
argsMap
The arguments map (null by default).
|
protected CommandLineHandler |
commandLineHandler
The command-line handler.
|
protected Configuration |
conf
The associated Configuration.
|
protected ConfigurationManager |
confmanager
The MDIApplication associated ConfigurationManager.
|
protected ErrorLogger |
errorLogger
The error logger.
|
protected java.util.List<Plugin> |
plugins
The list of loaded Plugins.
|
protected java.io.File |
pluginsConfiguration
The plugins definition xml file.
|
protected boolean |
pluginsDefInFile
True if the plugins definition is stored in a XML File (true by default).
|
protected java.io.File |
pluginsDir
The plugins directory.
|
protected PluginsManager |
pluginsManager
The MDIApplication associated PluginsManager.
|
protected java.util.Map<java.lang.String,Plugin> |
pluginsMap
The Map of loaded Plugins.
|
protected boolean |
preventOpening
True if the application must not be made visible.
|
protected ThreadQueue |
queue
The MDIApplication associated ThreadQueue (managing Actions).
|
protected long |
time |
| Constructor and Description |
|---|
AbstractJFXApplication() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addAdditionalPluginType(java.lang.String key,
AppliManifestType manifestType)
Add an additional Plugin type.
|
void |
addPluginDirectory(java.net.URL pluginDir)
Add an URL defining a directory where to look for Plugins.
|
protected boolean |
applyCommandLineArguments()
Apply the command-line arguments to both the application and its plugins.
|
protected ThreadQueue |
createThreadQueue()
Create the ThreadQueue.
|
void |
disposeApplication()
Dispose of the Application, and serialize its resources if a Configuration manager has been set.
|
void |
endAction(MDIAction action)
Ends a generic action.
|
void |
executeAction(MDIAction action,
short blockingType)
Execute a generic Action.
|
void |
executeAction(MDIAction action,
short blockingType,
java.lang.ClassLoader loader)
Execute a generic Action, using a specific Classloader.
|
java.util.Map<java.lang.String,AppliManifestType> |
getAdditionalPluginTypes()
Return the optional additional Plugin Types.
|
java.util.Map<java.lang.String,java.lang.Boolean> |
getAllowedPluginTypes()
Return the allowed Plugin Types.
|
java.util.Map<java.lang.String,java.lang.String> |
getCommandLineArguments()
Return the launch arguments of the application.
|
CommandLineHandler |
getCommandLineHandler()
Return the command-line handler.
|
ConfigurationManager |
getConfigurationManager()
Returns the Configuration Manager.
|
ErrorLogger |
getErrorLogger()
Return the error logger.
|
Plugin |
getPlugin(java.lang.String clazz,
boolean acceptAll)
Return the Plugin, given its associated class path.If
acceptAll is false and the plugin is not enabled, it will return null. |
Plugin |
getPluginForName(java.lang.String name,
boolean acceptAll)
Return a Plugin, given its associated name.
|
java.util.List<Plugin> |
getPlugins()
Return the list of Plugins.
|
short |
getPluginsDeactivationPolicy()
Return the plugins deactivation policy. return
PluginsDeactivationPolicy.DEACTIVATION_NOT_ALLOWED by default. |
PluginsEDTSupport |
getPluginsEDTSupport(PluginsManager manager)
Return the JavaFX support class for the GUI initialization of Plugins.
|
PluginsManager |
getPluginsManager()
Returns the PluginsManager.
|
java.util.Map<java.lang.String,Plugin> |
getPluginsMap()
Return the Map of Plugins.
|
ThreadQueue |
getThreadQueue()
Return the MDIApplication ThreadQueue.
|
long |
getTime()
Return the time after the last operation.
|
boolean |
hasPlugin(java.lang.String name)
Return true if the application has a Plugin of the specified name.
|
boolean |
hasPluginsDirectories()
Return true if there is a plugins directory or directory List.
|
boolean |
hasPluginsDirectoryList()
Return true if there is a plugins directory List.
|
boolean |
hasSinglePluginsDirectory()
Return true if there is a single plugins directory.
|
protected void |
initConfiguration()
Creates the Configuration, with no root Preferences.
|
void |
initConfiguration(java.util.prefs.Preferences prefRoot)
Creates the Configuration, and initialize it with a root Preference.
|
void |
initConfiguration(java.util.prefs.Preferences prefRoot,
short mdiPluginsInitMode)
Creates the Configuration, and initialize it with a root Preference.
|
boolean |
isDefaultBlockingActions()
Return true if actions are blocking by default.
|
boolean |
isEnabled(Plugin plugin)
Return true if a plugin is enabled.
|
boolean |
isEnabled(java.lang.String pluginName)
Return true if a plugin is enabled.
|
protected void |
loadResources()
Load resources used in the Application.
|
void |
noTimeMessages()
Do nothing by default.
|
void |
noWriteMessages()
Do nothing by default.
|
void |
pluginsActionPerformed(PluginsEvent event)
Does nothing by default.
|
boolean |
preventOpeningApplication()
Return true if the application must not be make visible.
|
protected void |
registerPlugins()
Register the Plugins.
|
void |
serializeConfiguration()
Serialize the configuration.
|
void |
setAllowedPluginTypes(java.util.Map<java.lang.String,java.lang.Boolean> allowedPluginTypes)
Set the allowed Plugin Types.
|
void |
setDefaultBlockingActions(boolean isBlocking)
Set if actions are blocking by default.
|
void |
setErrorLogger(ErrorLogger errorLogger)
Set the error logger.
|
protected void |
setPluginsConfiguration(java.io.File pluginsDir)
Set the plugins directory for the application.
|
protected void |
setPluginsConfiguration(java.io.File pluginsDir,
java.lang.String pluginsConfigFileName)
Set the plugins directory and configuration for the application.
|
protected void |
setPluginsConfigurationFile(java.io.File pluginsDir,
java.io.File pluginsConfiguration)
Set the plugins directory and configuration for the application.
|
boolean |
setPluginsDeactivationPolicy(short policy)
Set the plugins deactivation policy.Defer to
PluginsManager.setPluginsDeactivationPolicy(short) by default. |
void |
showActionException(java.lang.String message,
java.lang.Exception e)
Show the Exception stackTrace by default.
|
void |
startTime(MDIAction action)
Start to count the time for the last operation, and show the statusBar progress.
|
long |
stopTime(MDIAction action)
Return the time after the last operation and stop the progress bar if there is any.
|
getHostServices, getParameters, getUserAgentStylesheet, init, launch, launch, notifyPreloader, setUserAgentStylesheet, start, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexecuteAction, executeAction, getApplicationDesc, getApplicationID, getPlugin, getPluginForName, getStartDirectory, hasEnabledPlugingetCommandLineConfiguration, handleCommandLineArguments, handleCommandLineArguments, handleCommandLineException, setCommandLineHandlerprotected Configuration conf
protected long time
protected java.util.List<Plugin> plugins
protected java.util.Map<java.lang.String,Plugin> pluginsMap
protected java.io.File pluginsDir
protected ThreadQueue queue
protected java.io.File pluginsConfiguration
protected java.util.Map<java.lang.String,java.lang.Boolean> allowedPluginTypes
protected java.util.Map<java.lang.String,AppliManifestType> additionalPluginTypes
protected boolean pluginsDefInFile
pluginsConfigurationprotected ConfigurationManager confmanager
protected PluginsManager pluginsManager
protected ErrorLogger errorLogger
protected java.util.Map<java.lang.String,java.lang.String> argsMap
protected CommandLineHandler commandLineHandler
protected boolean preventOpening
protected final void initConfiguration()
public java.util.Map<java.lang.String,java.lang.Boolean> getAllowedPluginTypes()
PluginsManager.KEY_PLUGIN_TYPE attribute in their manifest will
have to match one of the Application allowed plugin type names.getAllowedPluginTypes in interface MDIApplicationpublic java.util.Map<java.lang.String,AppliManifestType> getAdditionalPluginTypes()
getAdditionalPluginTypes in interface MDIApplicationPluginsManager.setAdditionalPluginTypes(java.util.Map)public final void addPluginDirectory(java.net.URL pluginDir)
pluginDir - the directory as an URLpublic boolean preventOpeningApplication()
preventOpeningApplication in interface CommandLineListenerpublic CommandLineHandler getCommandLineHandler()
getCommandLineHandler in interface CommandLineListenerpublic java.util.Map<java.lang.String,java.lang.String> getCommandLineArguments()
getCommandLineArguments in interface MDIApplicationprotected boolean applyCommandLineArguments()
public void setDefaultBlockingActions(boolean isBlocking)
setDefaultBlockingActions in interface MDIApplicationisBlocking - true if actions are blocking by defaultpublic boolean isDefaultBlockingActions()
isDefaultBlockingActions in interface MDIApplicationprotected ThreadQueue createThreadQueue()
public final ThreadQueue getThreadQueue()
public PluginsEDTSupport getPluginsEDTSupport(PluginsManager manager)
getPluginsEDTSupport in interface MDIApplicationmanager - the PluginsManagerpublic final void setAllowedPluginTypes(java.util.Map<java.lang.String,java.lang.Boolean> allowedPluginTypes)
PluginsManager.KEY_PLUGIN_TYPE attribute in their manifest will
have to match one of the Application allowed plugin type names.allowedPluginTypes - the allowed Plugin typesPluginsManager.setAllowedPluginTypes(java.util.Map)protected void addAdditionalPluginType(java.lang.String key,
AppliManifestType manifestType)
key - the key to look for in the Plugin ManifestmanifestType - the type of the application relative to the manifest keyPluginsManager.setAdditionalPluginTypes(java.util.Map)public void setErrorLogger(ErrorLogger errorLogger)
errorLogger - the error loggerpublic ErrorLogger getErrorLogger()
getErrorLogger in interface MDIApplicationpublic boolean hasPluginsDirectories()
public boolean hasSinglePluginsDirectory()
public boolean hasPluginsDirectoryList()
protected void setPluginsConfigurationFile(java.io.File pluginsDir,
java.io.File pluginsConfiguration)
pluginsDir - the plugins directorypluginsConfiguration - the XML File holding the plugins entry-point classesprotected void setPluginsConfiguration(java.io.File pluginsDir,
java.lang.String pluginsConfigFileName)
pluginsDir - the plugins directorypluginsConfigFileName - the name of the XML File holding the plugins entry-point classesprotected void setPluginsConfiguration(java.io.File pluginsDir)
pluginsDir - the plugins directorypublic boolean setPluginsDeactivationPolicy(short policy)
PluginsManager.setPluginsDeactivationPolicy(short) by default.setPluginsDeactivationPolicy in interface MDIApplicationpolicy - the policypublic short getPluginsDeactivationPolicy()
PluginsDeactivationPolicy.DEACTIVATION_NOT_ALLOWED by default.getPluginsDeactivationPolicy in interface MDIApplicationpublic void pluginsActionPerformed(PluginsEvent event)
pluginsActionPerformed in interface PluginsListenerevent - the PluginsEventpublic void initConfiguration(java.util.prefs.Preferences prefRoot)
pluginsDir is not null, the application will look for Plugins in this directory. There are two ways of asking the applicatin
to load a Plugin in this directory (Plugins are distributed as jar Files in this directory):
pluginsDefInFile property is set to true, the application will look for an XML File called pluginsConfiguration,
defining the Plugin classes to loadpluginsDefInFile property is set to false, the application will look for the manifest of the Jar files in this
directoryinitConfiguration in interface MDIApplicationprefRoot - the root Preference, or null if there is no Preference for this MDIApplicationPluginsManagerpublic void initConfiguration(java.util.prefs.Preferences prefRoot,
short mdiPluginsInitMode)
pluginsDir is not null, the application will look for Plugins in this directory. There are two ways of asking the applicatin
to load a Plugin in this directory (Plugins are distributed as jar Files in this directory):
pluginsDefInFile property is set to true, the application will look for an XML File called pluginsConfiguration,
defining the Plugin classes to loadpluginsDefInFile property is set to false, the application will look for the manifest of the Jar files in this
directoryinitConfiguration in interface MDIApplicationprefRoot - the root Preference, or null if there is no Preference for this MDIApplicationmdiPluginsInitMode - the plugins initialization modePluginsManagerpublic void serializeConfiguration()
serializeConfiguration in interface MDIApplicationpublic void startTime(MDIAction action)
startTime in interface MDIApplicationaction - the actionpublic final long getTime()
getTime in interface MDIApplicationpublic long stopTime(MDIAction action)
stopTime in interface MDIApplicationaction - the actionpublic void executeAction(MDIAction action, short blockingType)
BlockingType.DEFAULT: use the default blocking type of the applicationBlockingType.BLOCKING: if the action should be blockingBlockingType.NOT_BLOCKING: if the action should not be blockingexecuteAction in interface MDIApplicationaction - the ActionblockingType - the enumeration specifying if the action should be blockingpublic void executeAction(MDIAction action, short blockingType, java.lang.ClassLoader loader)
BlockingType.DEFAULT: use the default blocking type of the applicationBlockingType.BLOCKING: if the action should be blockingBlockingType.NOT_BLOCKING: if the action should not be blockingexecuteAction in interface MDIApplicationaction - the ActionblockingType - the enumeration specifying if the action should be blockingloader - the ClassLoader to execute the actionpublic void showActionException(java.lang.String message,
java.lang.Exception e)
showActionException in interface MDIApplicationmessage - the messagee - the Exceptionprotected void registerPlugins()
public ConfigurationManager getConfigurationManager()
getConfigurationManager in interface MDIApplicationpublic PluginsManager getPluginsManager()
getPluginsManager in interface MDIApplicationpublic boolean isEnabled(java.lang.String pluginName)
isEnabled in interface MDIApplicationpluginName - the plugin namepublic boolean isEnabled(Plugin plugin)
isEnabled in interface MDIApplicationplugin - the pluginpublic final java.util.List<Plugin> getPlugins()
getPlugins in interface MDIApplicationpublic final java.util.Map<java.lang.String,Plugin> getPluginsMap()
getPluginsMap in interface MDIApplicationpublic boolean hasPlugin(java.lang.String name)
hasPlugin in interface MDIApplicationname - the Plugin namepublic final Plugin getPluginForName(java.lang.String name, boolean acceptAll)
acceptAll is false and the plugin is not enabled, it will return null.getPluginForName in interface MDIApplicationname - the Plugin nameacceptAll - true if disabled plugins are acceptedpublic final Plugin getPlugin(java.lang.String clazz, boolean acceptAll)
acceptAll is false and the plugin is not enabled, it will return null.getPlugin in interface MDIApplicationclazz - the plugin class pathacceptAll - true if disabled plugins are acceptedprotected void loadResources()
public void endAction(MDIAction action)
endAction in interface MDIApplicationaction - the actionpublic void disposeApplication()
disposeApplication in interface MDIApplicationpublic void noWriteMessages()
noWriteMessages in interface MDIApplicationpublic void noTimeMessages()
noTimeMessages in interface MDIApplication