Package ghidra.docking.settings
Class FormatSettingsDefinition
- java.lang.Object
-
- ghidra.docking.settings.FormatSettingsDefinition
-
- All Implemented Interfaces:
EnumSettingsDefinition,SettingsDefinition
public class FormatSettingsDefinition extends java.lang.Object implements EnumSettingsDefinition
The settings definition for the numeric display format
-
-
Field Summary
Fields Modifier and Type Field Description static intBINARYstatic intCHARstatic intDECIMALstatic FormatSettingsDefinitionDEFstatic FormatSettingsDefinitionDEF_CHARstatic FormatSettingsDefinitionDEF_DECIMALstatic FormatSettingsDefinitionDEF_HEXprotected static java.lang.StringFORMATstatic intHEXstatic intOCTAL
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear(Settings settings)Removes 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.intgetChoice(Settings settings)Returns the current value for this settingsjava.lang.StringgetDescription()Returns a description of this settings definitionjava.lang.StringgetDisplayChoice(int value, Settings s1)Returns the String for the given enum valuejava.lang.StringgetDisplayChoice(Settings settings)java.lang.String[]getDisplayChoices(Settings settings)Gets the list of choices as strings based on the current settingsintgetFormat(Settings settings)Returns the format based on the specified settingsjava.lang.StringgetName()Returns the name of this SettingsDefinitionintgetRadix(Settings settings)Returns the numeric radix associated with the format identified by the specified settings.booleanhasValue(Settings setting)voidsetChoice(Settings settings, int value)Sets the given value into the settings object using this definition as a keyvoidsetDisplayChoice(Settings settings, java.lang.String choice)Sets the settings object to the enum value indicating the specified choice as a string.
-
-
-
Field Detail
-
HEX
public static final int HEX
- See Also:
- Constant Field Values
-
DECIMAL
public static final int DECIMAL
- See Also:
- Constant Field Values
-
BINARY
public static final int BINARY
- See Also:
- Constant Field Values
-
OCTAL
public static final int OCTAL
- See Also:
- Constant Field Values
-
CHAR
public static final int CHAR
- See Also:
- Constant Field Values
-
FORMAT
protected static final java.lang.String FORMAT
- See Also:
- Constant Field Values
-
DEF_CHAR
public static final FormatSettingsDefinition DEF_CHAR
-
DEF_HEX
public static final FormatSettingsDefinition DEF_HEX
-
DEF_DECIMAL
public static final FormatSettingsDefinition DEF_DECIMAL
-
DEF
public static final FormatSettingsDefinition DEF
-
-
Method Detail
-
getFormat
public int getFormat(Settings settings)
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)
-
getRadix
public int getRadix(Settings settings)
Returns the numeric radix associated with the format identified by the specified settings.- Parameters:
settings- the instance settings.- Returns:
- the format radix
-
getChoice
public int getChoice(Settings settings)
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
-
setChoice
public void setChoice(Settings settings, int value)
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
public java.lang.String[] getDisplayChoices(Settings settings)
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
public java.lang.String getName()
Description copied from interface:SettingsDefinitionReturns the name of this SettingsDefinition- Specified by:
getNamein interfaceSettingsDefinition
-
getDescription
public java.lang.String getDescription()
Description copied from interface:SettingsDefinitionReturns a description of this settings definition- Specified by:
getDescriptionin interfaceSettingsDefinition
-
getDisplayChoice
public java.lang.String getDisplayChoice(int value, Settings s1)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
public void clear(Settings settings)
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
public void copySetting(Settings settings, Settings destSettings)
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
public boolean hasValue(Settings setting)
- Specified by:
hasValuein interfaceSettingsDefinition
-
getDisplayChoice
public java.lang.String getDisplayChoice(Settings settings)
-
setDisplayChoice
public void setDisplayChoice(Settings settings, java.lang.String choice)
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.
-
-