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
Fields inherited from interface ghidra.docking.settings.Settings
EMPTY_STRING_ARRAY
-
Constructor Summary
ConstructorDescriptionConstruct 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 TypeMethodDescriptionvoid
Removes all name-value pairs from this settings objectvoid
clearSetting
(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 nameboolean
isChangeAllowed
(SettingsDefinition settingsDefinition) Determine if a settings change corresponding to the specified settingsDefinition is permitted.boolean
isEmpty()
Returns true if there are no key-value pairs stored in this settings object.void
setDefaultSettings
(Settings settings) void
Associates the given long value with the name.void
Associates the given String value with the name.void
Associates the given object with the name.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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:Settings
Determine if a settings change corresponding to the specified settingsDefinition is permitted.- Specified by:
isChangeAllowed
in interfaceSettings
- Parameters:
settingsDefinition
- settings definition- Returns:
- true if change permitted else false
-
toString
-
isEmpty
public boolean isEmpty()Description copied from interface:Settings
Returns 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:Settings
Gets the Long value associated with the given name -
getString
Description copied from interface:Settings
Gets the String value associated with the given name -
setLong
Description copied from interface:Settings
Associates 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:Settings
Associates 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:Settings
Removes any value associated with the given name- Specified by:
clearSetting
in interfaceSettings
- Parameters:
name
- the key to remove any association
-
getNames
Description copied from interface:Settings
Get this list of keys that currently have values associated with them -
getValue
Description copied from interface:Settings
Gets the object associated with the given name -
setValue
Description copied from interface:Settings
Associates 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:Settings
Removes all name-value pairs from this settings object- Specified by:
clearAllSettings
in interfaceSettings
-
setDefaultSettings
-
getDefaultSettings
Description copied from interface:Settings
Returns the underlying default settings for these settings or null if there are none- Specified by:
getDefaultSettings
in interfaceSettings
- Returns:
- underlying default settings or null
-