@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(@NotNull com.electronwill.nightconfig.toml.TomlParser tomlParser,
@NotNull ApplicationProperties injectedApplicationProperties,
@NotNull VersionMeta injectedVersionMeta,
@NotNull Utilities injectedUtilities)
Initialize ServerPackCreators addons and give access to any and all available extensions.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addTabExtensionTabs(@NotNull javax.swing.JTabbedPane tabbedPane)
Add any and all additional tabs to the ServerPackCreator tabbed pane (main GUI).
|
@NotNull java.util.List<ConfigPanelExtension> |
configPanelExtensions()
List of available
ConfigPanelExtension-extensions. |
protected org.pf4j.ExtensionFactory |
createExtensionFactory() |
@NotNull java.util.Optional<com.electronwill.nightconfig.core.CommentedConfig> |
getAddonConfig(@NotNull java.lang.String addonId)
Get the global addon configuration for an addon of the passed ID.
|
@NotNull java.util.Optional<java.io.File> |
getAddonConfigFile(@NotNull java.lang.String addonId)
Get the configuration-file for an addon, if it exists.
|
@NotNull java.util.List<ExtensionConfigPanel> |
getConfigPanels(@NotNull TabCreateServerPack tabCreateServerPack)
Create config panels for the passed server pack configuration tab.
|
boolean |
runConfigCheckExtensions(@NotNull ConfigurationModel configurationModel,
@NotNull java.util.List<java.lang.String> encounteredErrors)
Run any and all configuration-check extensions, using the passed configuration model and the
destination at which the server pack is to be generated and stored at.
|
void |
runPostGenExtensions(@NotNull ConfigurationModel configurationModel,
@NotNull java.lang.String destination)
Run any and all Post-server pack-generation extensions, using the passed configuration model
and the destination at which the server pack is to be generated and stored at.
|
void |
runPreGenExtensions(@NotNull ConfigurationModel configurationModel,
@NotNull java.lang.String destination)
Run any and all Pre-Server Pack-Generation extensions, using the passed configuration model and
the destination at which the server pack is to be generated and stored at.
|
void |
runPreZipExtensions(@NotNull ConfigurationModel configurationModel,
@NotNull java.lang.String destination)
Run any and all Pre-ZIP-archive creation extensions, using the passed configuration model and
the destination at which the server pack is to be generated and stored at.
|
@NotNull 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(@NotNull
@NotNull com.electronwill.nightconfig.toml.TomlParser tomlParser,
@NotNull
@NotNull ApplicationProperties injectedApplicationProperties,
@NotNull
@NotNull VersionMeta injectedVersionMeta,
@NotNull
@NotNull 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.@NotNull public @NotNull java.util.List<TabExtension> tabExtensions()
TabExtension-extensions.TabExtension-extensions.@NotNull public @NotNull java.util.List<ConfigPanelExtension> configPanelExtensions()
ConfigPanelExtension-extensions.ConfigPanelExtension-extensions.protected org.pf4j.ExtensionFactory createExtensionFactory()
createExtensionFactory in class org.pf4j.DefaultPluginManagerpublic void runPreGenExtensions(@NotNull
@NotNull ConfigurationModel configurationModel,
@NotNull
@NotNull java.lang.String destination)
configurationModel - The configuration model from which to create the server pack.destination - The destination at which the server pack will be generated and stored
at.@NotNull
public @NotNull java.util.Optional<com.electronwill.nightconfig.core.CommentedConfig> getAddonConfig(@NotNull
@NotNull 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 void runPreZipExtensions(@NotNull
@NotNull ConfigurationModel configurationModel,
@NotNull
@NotNull java.lang.String destination)
configurationModel - The configuration model from which to create the server pack.destination - The destination at which the server pack will be generated and stored
at.public void runPostGenExtensions(@NotNull
@NotNull ConfigurationModel configurationModel,
@NotNull
@NotNull java.lang.String destination)
configurationModel - The configuration model from which to create the server pack.destination - The destination at which the server pack will be generated and stored
at.public void addTabExtensionTabs(@NotNull
@NotNull 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.@NotNull
public @NotNull java.util.Optional<java.io.File> getAddonConfigFile(@NotNull
@NotNull 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.@NotNull public @NotNull java.util.List<ExtensionConfigPanel> getConfigPanels(@NotNull @NotNull TabCreateServerPack tabCreateServerPack)
tabCreateServerPack - The server pack configuration tab to which the config panels are to
be added.public boolean runConfigCheckExtensions(@NotNull
@NotNull ConfigurationModel configurationModel,
@NotNull
@NotNull java.util.List<java.lang.String> encounteredErrors)
configurationModel - The configuration model containing the server pack and addon
configurations to check.encounteredErrors - A list of encountered errors to add to in case anything goes wrong.
This list is displayed to the user after am unsuccessful server pack
generation to help them figure out what went wrong.true if any custom check detected an error with the configuration.
Only return false when not a single check
errored.