Package ghidra.docking.settings
Class FormatSettingsDefinition
java.lang.Object
ghidra.docking.settings.FormatSettingsDefinition
- All Implemented Interfaces:
EnumSettingsDefinition,SettingsDefinition
The settings definition for the numeric display format
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final FormatSettingsDefinitionstatic final FormatSettingsDefinitionstatic final FormatSettingsDefinitionstatic final FormatSettingsDefinitionstatic final FormatSettingsDefinitionstatic final FormatSettingsDefinitionprotected static final Stringstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionvoidRemoves any values in the given settings object assocated with this settings definitionvoidcopySetting(Settings settings, Settings destSettings) Copies any setting value associated with this settings definition from the srcSettings settings to the destSettings.intReturns the current value for this settingsReturns a description of this settings definitiongetDisplayChoice(int value, Settings s1) Returns the String for the given enum valuegetDisplayChoice(Settings settings) String[]getDisplayChoices(Settings settings) Gets the list of choices as strings based on the current settingsintReturns the format based on the specified settingsgetName()Returns the display name of this SettingsDefinitionintReturns the numeric radix associated with the format identified by the specified settings.getRepresentationPostfix(Settings settings) Returns a descriptive string suffix that should be appended after converting a value using the radix returned bygetRadix(Settings).Get theSettingskey which is used when storing a key/value entry.getValueString(Settings settings) Get the setting value as a string which corresponds to this definition.booleanDetermine if a setting value has been storedvoidSets the given value into the settings object using this definition as a keyvoidsetDisplayChoice(Settings settings, String choice) Sets the settings object to the enum value indicating the specified choice as a string.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ghidra.docking.settings.EnumSettingsDefinition
hasSameValue
-
Field Details
-
HEX
public static final int HEX- See Also:
-
DECIMAL
public static final int DECIMAL- See Also:
-
BINARY
public static final int BINARY- See Also:
-
OCTAL
public static final int OCTAL- See Also:
-
CHAR
public static final int CHAR- See Also:
-
FORMAT
- See Also:
-
DEF_HEX
-
DEF_DECIMAL
-
DEF_BINARY
-
DEF_OCTAL
-
DEF_CHAR
-
DEF
-
-
Method Details
-
getFormat
Returns the format based on the specified settings- Parameters:
settings- the instance settings or null for default value.- Returns:
- the format value (HEX, DECIMAL, BINARY, OCTAL, CHAR), or HEX if invalid data in the FORMAT settings value
-
getRadix
Returns the numeric radix associated with the format identified by the specified settings.- Parameters:
settings- the instance settings.- Returns:
- the format radix
-
getRepresentationPostfix
Returns a descriptive string suffix that should be appended after converting a value using the radix returned bygetRadix(Settings).- Parameters:
settings- the instance settings- Returns:
- string suffix, such as "h" for HEX, "o" for octal
-
getChoice
Description copied from interface:EnumSettingsDefinitionReturns the current value for this settings- Specified by:
getChoicein interfaceEnumSettingsDefinition- Parameters:
settings- The settings to search- Returns:
- the value for the settingsDefintions
-
getValueString
Description copied from interface:SettingsDefinitionGet the setting value as a string which corresponds to this definition. A default value string will be returned if a setting has not been stored.- Specified by:
getValueStringin interfaceSettingsDefinition- Parameters:
settings- settings- Returns:
- value string or null if not set and default has not specified by this definition
-
setChoice
Description copied from interface:EnumSettingsDefinitionSets the given value into the settings object using this definition as a key- Specified by:
setChoicein interfaceEnumSettingsDefinition- Parameters:
settings- the settings to store the value.value- the settings value to be stored.
-
getDisplayChoices
Description copied from interface:EnumSettingsDefinitionGets the list of choices as strings based on the current settings- Specified by:
getDisplayChoicesin interfaceEnumSettingsDefinition- Parameters:
settings- the instance settings- Returns:
- an array of strings which represent valid choices based on the current settings.
-
getName
Description copied from interface:SettingsDefinitionReturns the display name of this SettingsDefinition- Specified by:
getNamein interfaceSettingsDefinition- Returns:
- display name for setting
-
getStorageKey
Description copied from interface:SettingsDefinitionGet theSettingskey which is used when storing a key/value entry.- Specified by:
getStorageKeyin interfaceSettingsDefinition- Returns:
- settings storage key
-
getDescription
Description copied from interface:SettingsDefinitionReturns a description of this settings definition- Specified by:
getDescriptionin interfaceSettingsDefinition- Returns:
- setting description
-
getDisplayChoice
Description copied from interface:EnumSettingsDefinitionReturns the String for the given enum value- Specified by:
getDisplayChoicein interfaceEnumSettingsDefinition- Parameters:
value- the value to get a display string fors1- the instance settings which may affect the results- Returns:
- the display string for the given settings.
-
clear
Description copied from interface:SettingsDefinitionRemoves any values in the given settings object assocated with this settings definition- Specified by:
clearin interfaceSettingsDefinition- Parameters:
settings- the settings object to be cleared.
-
copySetting
Description copied from interface:SettingsDefinitionCopies any setting value associated with this settings definition from the srcSettings settings to the destSettings.- Specified by:
copySettingin interfaceSettingsDefinition- Parameters:
settings- the settings to be copieddestSettings- the settings to be updated.
-
hasValue
Description copied from interface:SettingsDefinitionDetermine if a setting value has been stored- Specified by:
hasValuein interfaceSettingsDefinition- Parameters:
setting- stored settings- Returns:
- true if a value has been stored, else false
-
getDisplayChoice
-
setDisplayChoice
Sets the settings object to the enum value indicating the specified choice as a string.- Parameters:
settings- the settings to store the value.choice- enum string representing a choice in the enum.
-