Class PluginController
- java.lang.Object
-
- org.teichert.databaseexplorer.controllers.PluginController
-
public final class PluginController extends Object
The plugin-controller controls everything about plugins.
Here you can check if some plugins are active/loaded and add your localizations to the main application from plugin-side withaddLocalization(String)
.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addLocalization(String name)
This Method has to be invoked by any plugin which has localizations to be added.void
addLocalization(String path, String name)
This method will be invoked byaddLocalization(String)
void
addLocalization(String path, String languageDefinition, String name)
This method adds localizations toLoader.props
void
addPlugin(String pluginName, Class<? extends IPlugin> plugin)
This method adds the plugin to the cachedPlugins map.boolean
checkPluginActiv(String pluginName)
Checks if the plugin should be used or not.
If not, the plugin will not be loaded by the Classloader for security reasons.
By default, every plugin is not active to be secure.HashMap<String,Class<? extends IPlugin>>
getCachedPlugins()
Return the CachedPlugins map.
Only needed for internal usage.static PluginController
getInstance()
-
-
-
Method Detail
-
getInstance
public static PluginController getInstance()
-
addPlugin
public void addPlugin(String pluginName, Class<? extends IPlugin> plugin)
This method adds the plugin to the cachedPlugins map. Only needed for internal usage.- Parameters:
pluginName
-plugin
-
-
getCachedPlugins
public HashMap<String,Class<? extends IPlugin>> getCachedPlugins()
Return the CachedPlugins map.
Only needed for internal usage.- Returns:
-
checkPluginActiv
public boolean checkPluginActiv(String pluginName)
Checks if the plugin should be used or not.
If not, the plugin will not be loaded by the Classloader for security reasons.
By default, every plugin is not active to be secure.- Parameters:
pluginName
-- Returns:
-
addLocalization
public void addLocalization(String path, String languageDefinition, String name)
This method adds localizations toLoader.props
- Parameters:
path
- The path where to find the localisation fileslanguageDefinition
- The shot-name of the language like "de_DE" for germany or "en_EN" for englishname
- The Name of the properties files They must start with the language shortcut like "de_DE" for germany or "en_EN" for english separated by an underscore and then the normal name mostly the plugin-name. An Example could be something like: addLocalization("DBPluginHibernate");
-
addLocalization
public void addLocalization(String path, String name)
This method will be invoked byaddLocalization(String)
- Parameters:
path
- The path where to find the localisation filesname
- The Name of the properties files They must start with the language short-name like "de_DE" for germany or "en_EN" for english separated by an underscore and then the normal name mostly the plugin-name. An Example could be something like: addLocalization("DBPluginHibernate");
-
addLocalization
public void addLocalization(String name)
This Method has to be invoked by any plugin which has localizations to be added.- Parameters:
name
- The Name of the properties files They must start with the language shortcut like "de_DE" for germany or "en_EN" for english separated by an underscore and then the normal name mostly the plugin-name. An Example could be something like: addLocalization("DBPluginHibernate");
-
-