java.lang.Object
de.grogra.pf.registry.Plugin
de.grogra.pm.PluginManager
- All Implemented Interfaces:
RegistryContext
,Disposable
,ResourceConverter
-
Field Summary
Modifier and TypeFieldDescriptionprotected Map<PluginEntry,
Integer> static final String
static final String
static final String
static final int
static final I18NBundle
static final int
static final String
static final int
Fields inherited from interface de.grogra.util.ResourceConverter
CAT, LINK
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addMissingVersions
(PluginEntry pluginFromJSON) static void
applyChanges
(Item item, Object info, Context ctx) void
applyChanges
(GenericCallback<String> statusChanged, boolean doRestart, LinkedList<String> additionalGroIMPoptions) boolean
canHandleConversion
(String name) void
changeCallBack
(GenericCallback<Object> newCallBack) void
static void
clearCache
(Item item, Object info, Context ctx) void
containsPlugin
(String id) convert
(String name, String argument, I18NBundle bundle) static Panel
createPluginPanel
(Context ctx, Map params) static void
describeAllPlugins
(Item item, Object info, Context ctx) static void
describePlugin
(Item item, Object info, Context ctx) void
dispose()
static void
exportPluginList
(Item item, Object info, Context ctx) void
exportPluginList
(File output, GenericCallback<Object> statusChange) static String
static String
getChangesAsText
(boolean reload) getChangesAsText
(DependencyResolver resolver) static Set<PluginEntry>
getInstalledPlugins
(Map<PluginEntry, Integer> allPlugins) static PluginManager
getPluginByID
(String key) getPluginByName
(String key) getPluginFromRemoteRepo
(org.json.JSONArray json) Get the plugin entries from a json arraygetPluginFromRepo
(org.json.JSONArray json) static String
de.grogra.pm.repo.RepoManager
static String
boolean
boolean
static void
importPluginList
(Item item, Object info, Context ctx) void
importPluginList
(GenericCallback<Object> statusChanged, Context ctx) void
importPluginList
(File input, GenericCallback<Object> statusChanged) This set the plugin entries to match the set of plugin from the file input.void
void
load()
void
loadPluginFromLocalRepo
(File path) void
loadPluginFromRemoteRepo
(org.json.JSONArray json) void
loadPluginFromRepo
(org.json.JSONArray json) Load the plugins from the json array to the set of allPluginsvoid
void
static void
reloadRepositories
(Item item, Object info, Context ctx) scanPluginsDirectory
(Node dir) static void
selectVersion
(Item item, Object info, Context ctx) static void
setAllUpgrade
(Item item, Object info, Context ctx) void
setTimeout
(int timeout) void
startModifications
(Set<PluginEntry> delPlugins, Set<PluginEntry> installPlugins, Set<PluginEntry> disablePlugins, Set<PluginEntry> ablePlugins, boolean doRestart, LinkedList<String> additionalGroIMPptions) void
startup()
This method is invoked when the plugin is activated, i.e., when the first class defined by the plugin is loaded (except for the Plugin class itself).void
toggleInstalled
(PluginEntry plugin, int peState) Change the state of a plugin.void
togglePlugins
(Set<PluginEntry> pluginsToInstall, int isInstall) Methods inherited from class de.grogra.pf.registry.Plugin
checkConfigure, getI18NBundle, getPluginDescriptor, getRegistry, initialize, shutdown
-
Field Details
-
I18N
-
allPlugins
-
UNINSTALL
public static final int UNINSTALL- See Also:
-
INSTALL
public static final int INSTALL- See Also:
-
DISABLE
public static final int DISABLE- See Also:
-
REPO_PLUGIN_LIST
- See Also:
-
CACHE_REPO
- See Also:
-
CACHE_SOURCE_PATH
- See Also:
-
CACHE_PLUGIN_PATH
- See Also:
-
-
Constructor Details
-
PluginManager
public PluginManager()
-
-
Method Details
-
getInstance
-
startup
public void startup()Description copied from class:Plugin
This method is invoked when the plugin is activated, i.e., when the first class defined by the plugin is loaded (except for the Plugin class itself). The default implementation executes all executable items in the directory/hooks/startup/name
, wherename
is the name of the plugin.The method
Plugin.initialize()
has been invoked before. Only if this invocation has returnedtrue
, the plugin may be activated. -
canHandleConversion
- Specified by:
canHandleConversion
in interfaceResourceConverter
-
convert
- Specified by:
convert
in interfaceResourceConverter
-
initSources
public void initSources() -
hasPlugins
public boolean hasPlugins() -
load
- Throws:
Throwable
-
addMissingVersions
-
containsPlugin
-
startModifications
public void startModifications(Set<PluginEntry> delPlugins, Set<PluginEntry> installPlugins, Set<PluginEntry> disablePlugins, Set<PluginEntry> ablePlugins, boolean doRestart, LinkedList<String> additionalGroIMPptions) throws IOException - Throws:
IOException
-
applyChanges
public void applyChanges(GenericCallback<String> statusChanged, boolean doRestart, LinkedList<String> additionalGroIMPoptions) -
getChangesAsText
-
getChangesAsText
-
getChangesAsText
-
loadPluginFromLocalRepo
-
loadPluginFromRemoteRepo
public void loadPluginFromRemoteRepo(org.json.JSONArray json) -
loadPluginFromRepo
public void loadPluginFromRepo(org.json.JSONArray json) Load the plugins from the json array to the set of allPlugins- Parameters:
json
-
-
getPluginFromRemoteRepo
Get the plugin entries from a json array- Parameters:
json
-
-
getPluginFromRepo
-
getAlreadyInstalledPlugins
-
scanPluginsDirectory
-
getInstalledPlugins
-
getInstalledPlugins
-
getAvailablePlugins
-
getUpgradablePlugins
-
togglePlugins
-
toggleInstalled
Change the state of a plugin. States are checked when the modifications are resolved. The states are INSTALL, UNINSTALL, DISABLE.- Parameters:
plugin
-peState
-
-
hasAnyUpdates
public boolean hasAnyUpdates() -
getPluginByID
-
getPluginByName
-
setTimeout
public void setTimeout(int timeout) -
getPluginStatus
- Parameters:
id
- ID of the plugin to check- Returns:
- Version name for the plugin if it is installed, null otherwise
-
getAllPluginsStatus
- Returns:
- Status for all plugins
-
getAllPlugins
-
getAvailablePluginsAsString
- Returns:
- Available plugins
-
getUpgradablePluginsAsString
- Returns:
- Upgradable plugins
-
logPluginComponents
public void logPluginComponents() -
changeCallBack
-
dispose
public void dispose()- Specified by:
dispose
in interfaceDisposable
-
clearCache
- Throws:
IOException
-
reloadRepo
- Throws:
Throwable
-
clearRepo
- Throws:
Throwable
-
getMainRepo
-
exportPluginList
-
exportPluginList
-
importPluginList
This set the plugin entries to match the set of plugin from the file input. I.e. it deactivate plugins that are not in the list, and- Parameters:
input
-
-
importPluginList
-
importPluginList
-
clearCache
-
reloadRepositories
-
getRepoManager
public de.grogra.pm.repo.RepoManager getRepoManager() -
createPluginPanel
-
describeAllPlugins
-
describePlugin
-
selectVersion
-
applyChanges
-
setAllUpgrade
-