public abstract class AbstractJFXApplication extends javafx.application.Application implements MDIApplication, PluginsListener
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 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 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 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.
|
ConfigurationManager |
getConfigurationManager()
Returns the Configuration Manager.
|
ErrorLogger |
getErrorLogger()
Return the error logger.
|
Plugin |
getPlugin(java.lang.String clazz)
Return a Plugin, given its associated class path.
|
Plugin |
getPluginForName(java.lang.String name)
Return a Plugin, given its associated name.
|
java.util.List<Plugin> |
getPlugins()
Return the list of Plugins.
|
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.
|
protected void |
initConfiguration(java.util.prefs.Preferences prefRoot)
Creates the Configuration, and initialize it with a root Preference.
|
protected 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.
|
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.
|
protected void |
registerPlugins()
Register the Plugins.
|
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) |
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.
|
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, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
executeAction, executeAction, getApplicationDesc, getApplicationID, getCommandLineArguments, getStartDirectory
protected 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
pluginsConfiguration
protected ConfigurationManager confmanager
protected PluginsManager pluginsManager
protected ErrorLogger errorLogger
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 MDIApplication
public java.util.Map<java.lang.String,AppliManifestType> getAdditionalPluginTypes()
getAdditionalPluginTypes
in interface MDIApplication
PluginsManager.setAdditionalPluginTypes(java.util.Map)
public final void addPluginDirectory(java.net.URL pluginDir)
pluginDir
- the directory as an URLpublic void setDefaultBlockingActions(boolean isBlocking)
setDefaultBlockingActions
in interface MDIApplication
isBlocking
- true if actions are blocking by defaultpublic boolean isDefaultBlockingActions()
isDefaultBlockingActions
in interface MDIApplication
protected ThreadQueue createThreadQueue()
public final ThreadQueue getThreadQueue()
public PluginsEDTSupport getPluginsEDTSupport(PluginsManager manager)
getPluginsEDTSupport
in interface MDIApplication
manager
- 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)
public ErrorLogger getErrorLogger()
MDIApplication
getErrorLogger
in interface MDIApplication
public 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 void pluginsActionPerformed(PluginsEvent event)
pluginsActionPerformed
in interface PluginsListener
event
- the PluginsEventprotected 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 directoryprefRoot
- the root Preference, or null if there is no Preference for this MDIApplicationPluginsManager
protected 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 directoryprefRoot
- the root Preference, or null if there is no Preference for this MDIApplicationmdiPluginsInitMode
- the plugins initialization modePluginsManager
public void startTime(MDIAction action)
startTime
in interface MDIApplication
action
- the actionpublic final long getTime()
getTime
in interface MDIApplication
public long stopTime(MDIAction action)
stopTime
in interface MDIApplication
action
- 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 MDIApplication
action
- 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 MDIApplication
action
- 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 MDIApplication
message
- the messagee
- the Exceptionprotected void registerPlugins()
public ConfigurationManager getConfigurationManager()
getConfigurationManager
in interface MDIApplication
public PluginsManager getPluginsManager()
getPluginsManager
in interface MDIApplication
public final java.util.List<Plugin> getPlugins()
getPlugins
in interface MDIApplication
public final java.util.Map<java.lang.String,Plugin> getPluginsMap()
getPluginsMap
in interface MDIApplication
public boolean hasPlugin(java.lang.String name)
hasPlugin
in interface MDIApplication
name
- the Plugin namepublic final Plugin getPluginForName(java.lang.String name)
getPluginForName
in interface MDIApplication
name
- the Plugin namepublic final Plugin getPlugin(java.lang.String clazz)
getPlugin
in interface MDIApplication
clazz
- the plugin class pathprotected void loadResources()
public void endAction(MDIAction action)
endAction
in interface MDIApplication
action
- the actionpublic void disposeApplication()
disposeApplication
in interface MDIApplication
public void noWriteMessages()
noWriteMessages
in interface MDIApplication
public void noTimeMessages()
noTimeMessages
in interface MDIApplication