public interface IModEnv
Modifier and Type | Method and Description |
---|---|
java.nio.file.Path |
getCacheFolder()
Returns the external module cache folder.
|
IExtModManifestBean |
getManifest()
Returns the same external module manifest that was passed to the
IExternalModule.init(IExtModManifestBean, IServices, IModEnv) . |
java.nio.file.Path |
getRootFolder()
Returns the external module root folder.
|
ISettingsBean |
getSettingsBean(java.lang.String name)
Returns the
ISettingsBean associated with the specified name. |
java.util.List<ISettingsBean> |
getSettingsBeanList()
Returns the list of initialized settings beans in initialization order.
|
java.nio.file.Path |
getVersionFolder()
Returns the external module version folder.
|
ISettingsBean |
initSettingsBean(java.lang.String name,
java.util.List<ISetting<?>> validSettingList)
Creates a new
ISettingsBean and initializes it. |
IExtModManifestBean getManifest()
IExternalModule.init(IExtModManifestBean, IServices, IModEnv)
.
This is also provided here for convenience.
java.nio.file.Path getRootFolder()
The folder returned contains the version folder of the external module.
The root folder is the parent of the version folder.
getVersionFolder()
java.nio.file.Path getVersionFolder()
The folder returned contains the files of the external module, including the external module manifest file ( "Scelight-mod-x-manifest.xml"
).
The root folder is the parent of the version folder.
getRootFolder()
java.nio.file.Path getCacheFolder()
The folder returned may be used to store persistent files. The returned folder is unique to the external module, it is not shared with other external
modules (each external module has its own cache folder).
The cache folder is under the application workspace, and files stored in the cache folder are kept and will be available if the application is restarted.
Calling this method will also create the cache folder if it does not yet exist.
ISettingsBean initSettingsBean(java.lang.String name, java.util.List<ISetting<?>> validSettingList) throws java.lang.IllegalArgumentException
ISettingsBean
and initializes it.
The created and returned settings bean will be backed by a persistent file located in the cache folder.
The file name will be the specified name (postpended with the extension .xml
), so the specified name
must qualify for a file
name. Recommended to specify a name that ends with "-settings"
so it will be evident what the persistent file is.
Example: if the specified name is "server-settings"
, the persistent file will be "server-settings.xml"
under the cache folder.
If the backing file already exists, settings will be loaded from them. Invalid settings or settings having invalid values will be silently discarded during the loading.
The settings bean will be associated with the specified name, and can also be queried later with the getSettingsBean(String)
method.
Settings beans acquired via this method will automatically appear in the application settings dialog.
name
- name of the settings bean; this will also be the name of the backing persistent filevalidSettingList
- list of valid ISetting
s managed by the settings beanISettingsBean
java.lang.IllegalArgumentException
- if a settings bean with the specified name has already been initializedISettingsBean
,
getSettingsBeanList()
,
getSettingsBean(String)
java.util.List<ISettingsBean> getSettingsBeanList()
ISettingsBean getSettingsBean(java.lang.String name)
ISettingsBean
associated with the specified name.
The settings bean must be initialized prior to this call with the initSettingsBean(String, List)
.
name
- name of the settings bean to returnISettingsBean
associated with the specified name or null
if no settings bean have been initialized for the specified
nameinitSettingsBean(String, List)
,
getSettingsBeanList()
This API documentation is public and is intended for / allowed to be used by anyone.
Scelight home page: https://sites.google.com/site/scelight/
Scelight is a trademark of András Belicza. Copyright © András Belicza, 2013-2015. All rights reserved.