public class DefaultPluginsManager extends Object implements PluginsManager
Constructor and Description |
---|
DefaultPluginsManager() |
Modifier and Type | Method and Description |
---|---|
void |
addShutdownTask(String name,
Runnable task,
boolean in_event_thread,
int priority)
This method allows plugins register task to do after close the application.
|
void |
addStartupTask(String name,
Runnable task,
boolean in_event_thread,
int priority)
This method allows plugins register task to do before initializacion of
all gvSIG plugins.
|
void |
executeShutdownTasks()
This method executes registered task to run after the close of the application.
|
void |
executeStartupTasks()
This method executes registered task to run before the initialization of
all plugins.
|
File |
getApplicationFolder()
Returns the main application folder, where the application is installed.
|
File |
getApplicationHomeFolder()
Returns the application folder in the home of user.
|
File |
getApplicationI18nFolder()
Returns the default folder where the internationalization files are installed.
|
String |
getApplicationName() |
Version |
getApplicationVersion() |
ExclusiveUIExtension |
getExclusiveUIExtension()
Return the ExclusiveUIExtension installed in the application or
null.
|
IExtension |
getExtension(Class<? extends IExtension> extension)
Gets the instance of the extension whose class is provided.
|
Iterator<IExtension> |
getExtensions()
Return an iterator over al extensions loaded in the application.
|
FirewallConfiguration |
getFirewallConfiguration() |
File |
getInstallFolder()
Returns the default folder with the installable package bundles.
|
PackageInfo |
getPackageInfo()
Get the package info associated to the application.
|
PackageInfo |
getPackageInfo(Class<? extends IExtension> extension)
Get the package info associated to the plugin of the extension.
|
PackageInfo |
getPackageInfo(String pluginName)
Get the package info associated to the plugin with the specified name.
|
PluginServices |
getPlugin(Class<? extends IExtension> extension)
Return the associated pluginServices to the extension class passed as
parameter.
|
PluginServices |
getPlugin(Object obj)
Return the associated pluginServices to the object passed as parameter.
|
PluginServices |
getPlugin(String pluginName)
Return the associated pluginServices to the extension plugin.
|
List<PluginServices> |
getPlugins()
Return the list of plugins loaded in the application
|
File |
getPluginsDirectory()
Deprecated.
|
File |
getPluginsFolder()
Deprecated.
|
List<File> |
getPluginsFolders()
Returns a list of folder on the plugins are instaleds.
|
File |
getTempFile(String name)
Get the file name in the temporary folder of the plugins framework.
|
File |
getTempFile(String name,
String sufix)
Create a unique file name in the temporary folder of the plugins framework.
|
File |
getTempFolder()
Gets the temporary folder of the plugins framework.
|
String |
getText(Object obj,
String msg) |
List<IUnsavedData> |
getUnsavedData()
Return a list of unsaved data
|
void |
saveUnsavedData(List<IUnsavedData> unsavedData)
Save the provided unsaved data as parameter
|
void |
setExclusiveUIExtension(ExclusiveUIExtension extension)
Set an extension to control the visivility of all the extensions
of the application.
|
String |
translate(String msg)
Translate the message key to the current language used
in the application.
|
public ExclusiveUIExtension getExclusiveUIExtension()
PluginsManager
getExclusiveUIExtension
in interface PluginsManager
public IExtension getExtension(Class<? extends IExtension> extension)
PluginsManager
getExtension
in interface PluginsManager
public Iterator<IExtension> getExtensions()
PluginsManager
getExtensions
in interface PluginsManager
public PluginServices getPlugin(Class<? extends IExtension> extension)
getPlugin
in interface PluginsManager
public PluginServices getPlugin(Object obj)
PluginsManager
getPlugin
in interface PluginsManager
public PluginServices getPlugin(String pluginName)
PluginsManager
getPlugin
in interface PluginsManager
public PackageInfo getPackageInfo(Class<? extends IExtension> extension)
PluginsManager
getPackageInfo
in interface PluginsManager
extension
- extension of the pluginpublic PackageInfo getPackageInfo(String pluginName)
PluginsManager
getPackageInfo
in interface PluginsManager
public PackageInfo getPackageInfo()
PluginsManager
getPackageInfo
in interface PluginsManager
public List<PluginServices> getPlugins()
PluginsManager
getPlugins
in interface PluginsManager
public void setExclusiveUIExtension(ExclusiveUIExtension extension)
PluginsManager
setExclusiveUIExtension
in interface PluginsManager
public String getText(Object obj, String msg)
getText
in interface PluginsManager
#translate(String)}
public String translate(String msg)
PluginsManager
translate
in interface PluginsManager
msg
- key to translatepublic File getApplicationFolder()
PluginsManager
getApplicationFolder
in interface PluginsManager
public File getPluginsDirectory()
getPluginsFolders()
getPluginsDirectory
in interface PluginsManager
public File getPluginsFolder()
getPluginsFolders()
PluginsManager
getPluginsFolder
in interface PluginsManager
public List<File> getPluginsFolders()
PluginsManager
getPluginsFolders
in interface PluginsManager
public File getInstallFolder()
PluginsManager
getInstallFolder
in interface PluginsManager
public File getApplicationHomeFolder()
PluginsManager
getApplicationHomeFolder
in interface PluginsManager
public void addStartupTask(String name, Runnable task, boolean in_event_thread, int priority)
PluginsManager
addStartupTask
in interface PluginsManager
name
- of the tasktask
- runnable with the code of the taskpriority
- of the task.public void addShutdownTask(String name, Runnable task, boolean in_event_thread, int priority)
PluginsManager
addShutdownTask
in interface PluginsManager
name
- of the tasktask
- runnable with the code of the taskpriority
- of the task.public void executeStartupTasks()
PluginsManager
executeStartupTasks
in interface PluginsManager
public void executeShutdownTasks()
PluginsManager
executeShutdownTasks
in interface PluginsManager
public File getApplicationI18nFolder()
PluginsManager
getApplicationI18nFolder
in interface PluginsManager
public FirewallConfiguration getFirewallConfiguration()
getFirewallConfiguration
in interface PluginsManager
public Version getApplicationVersion()
getApplicationVersion
in interface PluginsManager
public List<IUnsavedData> getUnsavedData()
PluginsManager
getUnsavedData
in interface PluginsManager
public void saveUnsavedData(List<IUnsavedData> unsavedData) throws UnsavedDataException
PluginsManager
saveUnsavedData
in interface PluginsManager
UnsavedDataException
public String getApplicationName()
getApplicationName
in interface PluginsManager
public File getTempFolder()
PluginsManager
getTempFolder
in interface PluginsManager
public File getTempFile(String name)
PluginsManager
getTempFile
in interface PluginsManager
public File getTempFile(String name, String sufix)
PluginsManager
getTempFile
in interface PluginsManager
name
- base name used for create the unique file namesufix
- to add the the unique file name