@Component
public final class ApplicationAddons
extends org.pf4j.JarPluginManager
TabExtension,PreGenExtension,PreZipExtension and
PostGenExtension so they can then be run during server pack generation and during
initialization of the GUI.DEFAULT_PLUGINS_DIR, dependencyResolver, DEVELOPMENT_PLUGINS_DIR, exactVersionAllowed, extensionFactory, extensionFinder, MODE_PROPERTY_NAME, pluginClassLoaders, pluginDescriptorFinder, pluginFactory, pluginLoader, pluginRepository, plugins, PLUGINS_DIR_PROPERTY_NAME, pluginsRoots, pluginStateListeners, pluginStatusProvider, resolvedPlugins, runtimeMode, startedPlugins, systemVersion, unresolvedPlugins, versionManager| Constructor and Description |
|---|
ApplicationAddons(com.electronwill.nightconfig.toml.TomlParser tomlParser,
ApplicationProperties injectedApplicationProperties,
VersionMeta injectedVersionMeta,
Utilities injectedUtilities)
Initialize ServerPackCreators addons and give access to any and all available extensions.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addTabExtensionTabs(javax.swing.JTabbedPane tabbedPane)
Add any and all additional tabs to the ServerPackCreator tabbed pane (main GUI).
|
java.util.List<ConfigPanelExtension> |
configPanelExtensions()
List of available
ConfigPanelExtension-extensions. |
protected org.pf4j.ExtensionFactory |
createExtensionFactory() |
java.util.Optional<com.electronwill.nightconfig.core.CommentedConfig> |
getAddonConfig(java.lang.String addonId)
Get the global addon configuration for an addon of the passed ID.
|
java.util.Optional<java.io.File> |
getAddonConfigFile(java.lang.String addonId)
Get the configuration-file for an addon, if it exists.
|
java.util.List<ExtensionConfigPanel> |
getConfigPanels(TabCreateServerPack tabCreateServerPack)
Create config panels for the passed server pack configuration tab.
|
java.util.List<TabExtension> |
tabExtensions()
List of available
TabExtension-extensions. |
createPluginDescriptorFinder, createPluginLoader, createPluginRepositorycreateExtensionFinder, createPluginFactory, createPluginStatusProvider, createVersionManager, initialize, loadPluginFromPathaddPluginStateListener, checkPluginId, createPluginsRoot, createPluginWrapper, deletePlugin, disablePlugin, enablePlugin, firePluginStateEvent, getExtensionClasses, getExtensionClasses, getExtensionClasses, getExtensionClasses, getExtensionClassNames, getExtensionFactory, getExtensions, getExtensions, getExtensions, getExtensions, getPlugin, getPluginClassLoader, getPluginClassLoaders, getPluginDescriptorFinder, getPluginFactory, getPluginLabel, getPluginLoader, getPlugins, getPlugins, getPluginsRoot, getPluginsRoots, getResolvedPlugins, getRuntimeMode, getStartedPlugins, getSystemVersion, getUnresolvedPlugins, getVersion, getVersionManager, idForPath, isExactVersionAllowed, isPluginDisabled, isPluginValid, loadPlugin, loadPlugins, removePluginStateListener, resolvePlugins, setExactVersionAllowed, setSystemVersion, startPlugin, startPlugins, stopPlugin, stopPlugin, stopPlugins, unloadPlugin, unloadPlugin, unloadPlugins, validatePluginDescriptor, whichPlugin@Autowired
public ApplicationAddons(com.electronwill.nightconfig.toml.TomlParser tomlParser,
ApplicationProperties injectedApplicationProperties,
VersionMeta injectedVersionMeta,
Utilities injectedUtilities)
tomlParser - To read addon-configurations, so they can be provided to
extensions.injectedApplicationProperties - ServerPackCreator settings to be provided to extensions.injectedVersionMeta - Version meta to be provided to extensions.injectedUtilities - Utilities to be provided to extensions.protected org.pf4j.ExtensionFactory createExtensionFactory()
createExtensionFactory in class org.pf4j.DefaultPluginManagerpublic java.util.Optional<com.electronwill.nightconfig.core.CommentedConfig> getAddonConfig(java.lang.String addonId)
Optional, because an addon may not provide a global configuration. If you intend
on using a global configuration for your addon, make sure to check whether it is present before
trying to use it!addonId - The addon ID of the...well...addon.public java.util.Optional<java.io.File> getAddonConfigFile(java.lang.String addonId)
Optional,
because not every addon may provide a configuration-file to use globally for the relevant
addons settings. If you intend on using a global configuration, make sure to check whether the
file is present, before moving on!addonId - The addon ID with which to identify the correct config-file to return.public void addTabExtensionTabs(javax.swing.JTabbedPane tabbedPane)
JTabbedPane, if you so desire. Could be pretty awesome to
have your addons extra tabs in a separate window!tabbedPane - The tabbed pane to which the additional panels should be added to as tabs.public java.util.List<ExtensionConfigPanel> getConfigPanels(TabCreateServerPack tabCreateServerPack)
tabCreateServerPack - The server pack configuration tab to which the config panels are to
be added.public java.util.List<TabExtension> tabExtensions()
TabExtension-extensions.TabExtension-extensions.public java.util.List<ConfigPanelExtension> configPanelExtensions()
ConfigPanelExtension-extensions.ConfigPanelExtension-extensions.