Package ghidra.docking.settings
Class SettingsImpl
java.lang.Object
ghidra.docking.settings.SettingsImpl
- All Implemented Interfaces:
Settings,Serializable
Basic implementation of the Settings object
- See Also:
-
Field Summary
FieldsFields inherited from interface ghidra.docking.settings.Settings
EMPTY_STRING_ARRAY -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a new SettingsImpl.SettingsImpl(boolean immutable) Construct a new SettingsImpl.SettingsImpl(Settings settings) Construct a new SettingsImpl object.SettingsImpl(Predicate<String> allowedSettingPredicate) Construct a new SettingsImpl with a modification predicate.SettingsImpl(ChangeListener listener, Object changeSourceObj) Construct a new SettingsImpl with the given listener -
Method Summary
Modifier and TypeMethodDescriptionvoidRemoves all name-value pairs from this settings objectvoidclearSetting(String name) Removes any value associated with the given nameReturns the underlying default settings for these settings or null if there are noneGets the Long value associated with the given nameString[]getNames()Get this list of keys that currently have values associated with themGets the String value associated with the given nameGets the object associated with the given namebooleanisChangeAllowed(SettingsDefinition settingsDefinition) Determine if a settings change corresponding to the specified settingsDefinition is permitted.booleanisEmpty()Returns true if there are no key-value pairs stored in this settings object.voidsetDefaultSettings(Settings settings) voidAssociates the given long value with the name.voidAssociates the given String value with the name.voidAssociates the given object with the name.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ghidra.docking.settings.Settings
getSuggestedValues
-
Field Details
-
NO_SETTINGS
-
-
Constructor Details
-
SettingsImpl
public SettingsImpl()Construct a new SettingsImpl. -
SettingsImpl
Construct a new SettingsImpl with a modification predicate.- Parameters:
allowedSettingPredicate- callback for checking an allowed setting modification
-
SettingsImpl
Construct a new SettingsImpl object. If settings object is specified this settings will copy all name/value pairs and underlying defaults.- Parameters:
settings- the settings object to copy
-
SettingsImpl
public SettingsImpl(boolean immutable) Construct a new SettingsImpl.- Parameters:
immutable- if true settings are immutable with the exception of setting its default settings. If false settings may be modified.
-
SettingsImpl
Construct a new SettingsImpl with the given listener- Parameters:
listener- object to be notified as settings values changechangeSourceObj- source object to be associated with change events
-
-
Method Details
-
isChangeAllowed
Description copied from interface:SettingsDetermine if a settings change corresponding to the specified settingsDefinition is permitted.- Specified by:
isChangeAllowedin interfaceSettings- Parameters:
settingsDefinition- settings definition- Returns:
- true if change permitted else false
-
toString
-
isEmpty
public boolean isEmpty()Description copied from interface:SettingsReturns true if there are no key-value pairs stored in this settings object. This is not a reflection of the underlying default settings which may still contain a key-value pair when this settings object is empty. -
getLong
Description copied from interface:SettingsGets the Long value associated with the given name -
getString
Description copied from interface:SettingsGets the String value associated with the given name -
setLong
Description copied from interface:SettingsAssociates the given long value with the name. Note that an attempted setting change may be ignored if prohibited (e.g., immutable Settings, undefined setting name). -
setString
Description copied from interface:SettingsAssociates the given String value with the name. Note that an attempted setting change may be ignored if prohibited (e.g., immutable Settings, undefined setting name). -
clearSetting
Description copied from interface:SettingsRemoves any value associated with the given name- Specified by:
clearSettingin interfaceSettings- Parameters:
name- the key to remove any association
-
getNames
Description copied from interface:SettingsGet this list of keys that currently have values associated with them -
getValue
Description copied from interface:SettingsGets the object associated with the given name -
setValue
Description copied from interface:SettingsAssociates the given object with the name. Note that an attempted setting change may be ignored if prohibited (e.g., immutable Settings, undefined setting name). -
clearAllSettings
public void clearAllSettings()Description copied from interface:SettingsRemoves all name-value pairs from this settings object- Specified by:
clearAllSettingsin interfaceSettings
-
setDefaultSettings
-
getDefaultSettings
Description copied from interface:SettingsReturns the underlying default settings for these settings or null if there are none- Specified by:
getDefaultSettingsin interfaceSettings- Returns:
- underlying default settings or null
-