Package ghidra.framework.options
Class ToolOptions
java.lang.Object
ghidra.framework.options.AbstractOptions
ghidra.framework.options.ToolOptions
- All Implemented Interfaces:
Options
Class to manage a set of option name/value pairs for a category.
The values may be primitives or WrappedOptions that are containers for primitive
components.
The name/value pair has an owner so that the option name can be removed from the Options object when it is no longer being used.
Note: Property Names can have Options.DELIMITER characters to create a hierarchy.
So too can sub-options accessed via AbstractOptions.getOptions(String).
The Options Dialog shows the delimited hierarchy in tree format.
-
Nested Class Summary
Nested classes/interfaces inherited from class ghidra.framework.options.AbstractOptions
AbstractOptions.AliasBinding -
Field Summary
FieldsFields inherited from class ghidra.framework.options.AbstractOptions
aliasMap, categoryHelpMap, listeners, name, optionsEditorMap, SUPPORTED_CLASSES, themeListener, themeToOptionMap, valueMapFields inherited from interface ghidra.framework.options.Options
DELIMITER, DELIMITER_STRING, ILLEGAL_DELIMITER -
Constructor Summary
ConstructorsConstructorDescriptionToolOptions(String name) ToolOptions(org.jdom.Element root) Construct a new Options object from the given XML element. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd the options change listener.copy()voidcopyOptions(Options newOptions) Adds all the options name/value pairs to this Options.protected OptioncreateRegisteredOption(String optionName, OptionType type, String description, HelpLocation help, Object defaultValue, PropertyEditor editor) protected OptioncreateUnregisteredOption(String optionName, OptionType type, Object defaultValue) voiddispose()booleanorg.jdom.ElementgetXmlRoot(boolean includeDefaultBindings) Return an XML element for the option names and values.inthashCode()protected booleannotifyOptionChanged(String optionName, Object oldValue, Object newValue) voidregisterOptions(ToolOptions oldOptions) voidRemove the options change listener.voidCheck each option to ensure that an owner is still registered for it; if there is no owner, then remove the option.voidtakeListeners(ToolOptions oldOptions) voidMethods inherited from class ghidra.framework.options.AbstractOptions
contains, createAlias, findPropertyEditor, getActionTrigger, getBoolean, getByteArray, getCategoryHelpLocation, getChildOptions, getColor, getCustomOption, getDate, getDefaultValue, getDefaultValueAsString, getDescription, getDouble, getEnum, getFile, getFloat, getFont, getHelpLocation, getID, getInt, getKeyStroke, getLeafOptionNames, getLong, getName, getObject, getOption, getOptionNames, getOptions, getOptionsEditor, getOptionsEditor, getOptionsHelpLocation, getPropertyEditor, getRegisteredPropertyEditor, getString, getType, getValueAsString, isAlias, isDefaultValue, isRegistered, putObject, putObject, registerOption, registerOption, registerOption, registerOptionsEditor, registerOptionsEditor, registerThemeColorBinding, registerThemeFontBinding, removeOption, restoreDefaultValue, restoreDefaultValues, setActionTrigger, setBoolean, setByteArray, setCategoryHelpLocation, setColor, setCustomOption, setDate, setDouble, setEnum, setFile, setFloat, setFont, setInt, setKeyStroke, setLong, setName, setOptionsHelpLocation, setString, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface ghidra.framework.options.Options
registerOption, registerOptionsEditor
-
Field Details
-
PRIMITIVE_CLASSES
-
WRAPPABLE_CLASSES
-
XML_ELEMENT_NAME
- See Also:
-
-
Constructor Details
-
ToolOptions
-
ToolOptions
public ToolOptions(org.jdom.Element root) Construct a new Options object from the given XML element.- Parameters:
root- XML that contains the set of options to restore
-
-
Method Details
-
copy
-
getXmlRoot
public org.jdom.Element getXmlRoot(boolean includeDefaultBindings) Return an XML element for the option names and values. Note: only those options which have been explicitly set will be included.- Parameters:
includeDefaultBindings- true to include default key binding values in the xml- Returns:
- the xml root element
-
addOptionsChangeListener
Add the options change listener. NOTE: The Options uses WeakReferences to manage the listeners; this means that you must supply a listener and maintain a handle to it, or else the listener will be garbage collected and will never get called. So for this reason, do not create the listener in an anonymous inner class.- Parameters:
l- listener to add
-
takeListeners
-
removeOptionsChangeListener
Remove the options change listener.- Parameters:
l- listener to remove
-
removeUnusedOptions
public void removeUnusedOptions()Check each option to ensure that an owner is still registered for it; if there is no owner, then remove the option. -
copyOptions
Adds all the options name/value pairs to this Options.- Parameters:
newOptions- the new options into which the current options values will be placed
-
hashCode
public int hashCode() -
equals
-
validateOptions
public void validateOptions() -
registerOptions
-
createRegisteredOption
protected Option createRegisteredOption(String optionName, OptionType type, String description, HelpLocation help, Object defaultValue, PropertyEditor editor) - Specified by:
createRegisteredOptionin classAbstractOptions
-
createUnregisteredOption
- Specified by:
createUnregisteredOptionin classAbstractOptions
-
notifyOptionChanged
- Specified by:
notifyOptionChangedin classAbstractOptions
-
dispose
public void dispose()- Overrides:
disposein classAbstractOptions
-