public class JIPipeSettingsRegistry extends AbstractJIPipeParameterCollection implements JIPipeCustomParameterCollection, JIPipeParameterCollection.ParameterChangedEventListener
Modifier and Type | Class and Description |
---|---|
static class |
JIPipeSettingsRegistry.Sheet
A settings sheet
|
JIPipeParameterCollection.ParameterChangedEvent, JIPipeParameterCollection.ParameterChangedEventEmitter, JIPipeParameterCollection.ParameterChangedEventListener, JIPipeParameterCollection.ParameterStructureChangedEvent, JIPipeParameterCollection.ParameterStructureChangedEventEmitter, JIPipeParameterCollection.ParameterStructureChangedEventListener, JIPipeParameterCollection.ParameterUIChangedEvent, JIPipeParameterCollection.ParameterUIChangedEventEmitter, JIPipeParameterCollection.ParameterUIChangedEventListener
Constructor and Description |
---|
JIPipeSettingsRegistry(JIPipe jiPipe) |
Modifier and Type | Method and Description |
---|---|
JIPipe |
getJIPipe() |
Map<String,JIPipeParameterAccess> |
getParameters()
Returns all parameters
Please note that those parameters must be sourced in this collection.
|
static Path |
getPropertyFile() |
static com.fasterxml.jackson.databind.JsonNode |
getRawNode()
Gets the raw property files Json node
|
BiMap<String,JIPipeSettingsRegistry.Sheet> |
getRegisteredSheets() |
<T extends JIPipeParameterCollection> |
getSettings(String id,
Class<T> settingsClass)
Gets the settings instance with given ID
|
void |
load(Path file)
Loads settings from the specified file
|
void |
onParameterChanged(JIPipeParameterCollection.ParameterChangedEvent event) |
void |
register(String id,
String name,
Icon icon,
String category,
Icon categoryIcon,
JIPipeParameterCollection parameterCollection)
Registers a new settings sheet
|
void |
register(String id,
String name,
String description,
Icon icon,
String category,
Icon categoryIcon,
JIPipeParameterCollection parameterCollection)
Registers a new settings sheet
|
void |
reload()
Reloads the settings from the default file if it exists
|
void |
save()
Saves the settings to the default settings file
|
void |
save(Path file)
Saves the settings to the specified file
|
getParameterChangedEventEmitter, getParameterStructureChangedEventEmitter, getParameterUIChangedEventEmitter
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getChildParameterCollections, getIncludeReflectionParameters
emitParameterChangedEvent, emitParameterStructureChangedEvent, emitParameterUIChangedEvent, getContextActions, getParameter, getParameterAccess, getParameterChangedEventEmitter, getParameterStructureChangedEventEmitter, getParameterUIChangedEventEmitter, installUIOverrideParameterEditor, installUIParameterOptions, isParameterUIVisible, isParameterUIVisible, setParameter
public JIPipeSettingsRegistry(JIPipe jiPipe)
public static com.fasterxml.jackson.databind.JsonNode getRawNode()
public static Path getPropertyFile()
public void register(String id, String name, Icon icon, String category, Icon categoryIcon, JIPipeParameterCollection parameterCollection)
id
- unique ID of the sheetname
- sheet nameicon
- sheet iconcategory
- sheet category. If left null or empty, it will default to "General"categoryIcon
- optional icon. If null, a wrench icon is used.parameterCollection
- the object that holds the parameterspublic void register(String id, String name, String description, Icon icon, String category, Icon categoryIcon, JIPipeParameterCollection parameterCollection)
id
- unique ID of the sheetname
- sheet namedescription
- sheet descriptionicon
- sheet iconcategory
- sheet category. If left null or empty, it will default to "General"categoryIcon
- optional icon. If null, a wrench icon is used.parameterCollection
- the object that holds the parameterspublic <T extends JIPipeParameterCollection> T getSettings(String id, Class<T> settingsClass)
T
- the settings classid
- the IDsettingsClass
- the settings classpublic BiMap<String,JIPipeSettingsRegistry.Sheet> getRegisteredSheets()
public Map<String,JIPipeParameterAccess> getParameters()
JIPipeCustomParameterCollection
getParameters
in interface JIPipeCustomParameterCollection
JIPipeParameterAccess
.getKey()public void save(Path file)
file
- the file pathpublic void save()
public void load(Path file)
file
- the filepublic void reload()
public JIPipe getJIPipe()
public void onParameterChanged(JIPipeParameterCollection.ParameterChangedEvent event)
onParameterChanged
in interface JIPipeParameterCollection.ParameterChangedEventListener
Copyright © 2020–2023 Leibniz Institute for Natural Product Research and Infection Biology - Hans Knöll Institute (HKI). All rights reserved.