Package ghidra.framework.options
Interface Options
- 
- All Known Implementing Classes:
- AbstractOptions,- SubOptions,- ToolOptions
 
 public interface Options
- 
- 
Field SummaryFields Modifier and Type Field Description static charDELIMITERstatic java.lang.StringDELIMITER_STRINGstatic java.lang.StringILLEGAL_DELIMITER
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancontains(java.lang.String optionName)Return true if a option exists with the given name.voidcreateAlias(java.lang.String aliasName, Options options, java.lang.String optionsName)Create an alias in this options for an existing option in some other options object.booleangetBoolean(java.lang.String optionName, boolean defaultValue)Get the boolean value for the given option name.byte[]getByteArray(java.lang.String optionName, byte[] defaultValue)Get the byte array for the given option name.java.util.List<Options>getChildOptions()Returns a list of Options objects that are nested one level down from this Options object.java.awt.ColorgetColor(java.lang.String optionName, java.awt.Color defaultValue)Get the Color for the given option name.CustomOptiongetCustomOption(java.lang.String optionName, CustomOption defaultValue)Get the custom option value for the given option name.java.util.DategetDate(java.lang.String pName, java.util.Date date)Get the Date for the given option name.java.lang.ObjectgetDefaultValue(java.lang.String optionName)Returns the default value for the given option.java.lang.StringgetDefaultValueAsString(java.lang.String analyzerName)Returns the default value as a string for the given option.java.lang.StringgetDescription(java.lang.String optionName)Get the description for the given option name.doublegetDouble(java.lang.String optionName, double defaultValue)Get the double value for the given option name.<T extends java.lang.Enum<T>>
 TgetEnum(java.lang.String optionName, T defaultValue)Get the Enum value for the given option name.java.io.FilegetFile(java.lang.String optionName, java.io.File defaultValue)Get the File for the given option name.floatgetFloat(java.lang.String optionName, float defaultValue)Get the float value for the given option name.java.awt.FontgetFont(java.lang.String optionName, java.awt.Font defaultValue)Get the Font for the given option name.HelpLocationgetHelpLocation(java.lang.String optionName)Get the location for where help can be found for the option with the given name.java.lang.StringgetID(java.lang.String optionName)Returns a unique id for option in this options with the given name.intgetInt(java.lang.String optionName, int defaultValue)Get the int value for the given option name.javax.swing.KeyStrokegetKeyStroke(java.lang.String optionName, javax.swing.KeyStroke defaultValue)Get the KeyStrokg for the given action name.java.util.List<java.lang.String>getLeafOptionNames()Returns a list of option names that immediately fall under this options.longgetLong(java.lang.String optionName, long defaultValue)Get the long value for the given option name.java.lang.StringgetName()Get the name of this options object.java.lang.ObjectgetObject(java.lang.String optionName, java.lang.Object defaultValue)Get the object value; called when the options dialog is being populated.java.util.List<java.lang.String>getOptionNames()Get the list of option names.OptionsgetOptions(java.lang.String path)Returns a Options object that is a sub-options of this options.OptionsEditorgetOptionsEditor()Get the editor that will handle editing all the values in this options or sub group of options.HelpLocationgetOptionsHelpLocation()Returns the HelpLocation for this entire Options object.java.beans.PropertyEditorgetPropertyEditor(java.lang.String optionName)Get the property editor for the option with the given name.java.beans.PropertyEditorgetRegisteredPropertyEditor(java.lang.String optionName)Get the property editor that was registered for the specific option with the given name.java.lang.StringgetString(java.lang.String optionName, java.lang.String defaultValue)Get the string value for the given option name.OptionTypegetType(java.lang.String optionName)Returns the OptionType of the given option.java.lang.StringgetValueAsString(java.lang.String name)Returns the value as a string for the given option.booleanisAlias(java.lang.String aliasName)ReturnsbooleanisDefaultValue(java.lang.String optionName)Returns true if the option with the given name's current value is the default value.booleanisRegistered(java.lang.String optionName)Returns true if the specified option has been registered.voidputObject(java.lang.String optionName, java.lang.Object obj)Put the object value.voidregisterOption(java.lang.String optionName, OptionType type, java.lang.Object defaultValue, HelpLocation help, java.lang.String description)Registers an option with a description, help location, and a optional default value.voidregisterOption(java.lang.String optionName, OptionType type, java.lang.Object defaultValue, HelpLocation help, java.lang.String description, java.beans.PropertyEditor editor)Registers an option with a description, help location, and a optional default value.voidregisterOption(java.lang.String optionName, java.lang.Object defaultValue, HelpLocation help, java.lang.String description)Registers an option with a description, help location, and a default value without specifying the option type.voidregisterOptionsEditor(OptionsEditor editor)Register the options editor that will handle the editing for all the options or a sub group of options.voidremoveOption(java.lang.String optionName)Remove the option name.voidrestoreDefaultValue(java.lang.String optionName)Restores the option denoted by the given name to its default value.voidrestoreDefaultValues()Restores all options contained herein to their default values.voidsetBoolean(java.lang.String optionName, boolean value)Sets the boolean value for the option.voidsetByteArray(java.lang.String optionName, byte[] value)Sets the byte[] value for the given option name.voidsetColor(java.lang.String optionName, java.awt.Color value)Sets the Color value for the optionvoidsetCustomOption(java.lang.String optionName, CustomOption value)Sets the Custom option value for the option.voidsetDate(java.lang.String optionName, java.util.Date newSetting)Sets the Date value for the option.voidsetDouble(java.lang.String optionName, double value)Sets the double value for the option.<T extends java.lang.Enum<T>>
 voidsetEnum(java.lang.String optionName, T value)Set the Enum value for the option.voidsetFile(java.lang.String optionName, java.io.File value)Sets the File value for the option.voidsetFloat(java.lang.String optionName, float value)Sets the float value for the option.voidsetFont(java.lang.String optionName, java.awt.Font value)Sets the Font value for the optionvoidsetInt(java.lang.String optionName, int value)Sets the int value for the option.voidsetKeyStroke(java.lang.String optionName, javax.swing.KeyStroke value)Sets the KeyStroke value for the optionvoidsetLong(java.lang.String optionName, long value)Sets the long value for the option.voidsetOptionsHelpLocation(HelpLocation helpLocation)Set the location for where help can be found for this entire options object.voidsetString(java.lang.String optionName, java.lang.String value)Set the String value for the option.
 
- 
- 
- 
Field Detail- 
DELIMITERstatic final char DELIMITER - See Also:
- Constant Field Values
 
 - 
DELIMITER_STRINGstatic final java.lang.String DELIMITER_STRING 
 - 
ILLEGAL_DELIMITERstatic final java.lang.String ILLEGAL_DELIMITER 
 
- 
 - 
Method Detail- 
getNamejava.lang.String getName() Get the name of this options object.- Returns:
- String
 
 - 
getIDjava.lang.String getID(java.lang.String optionName) Returns a unique id for option in this options with the given name. This will be the full path name to the root options object.- Parameters:
- optionName- the name of the option for which to get an ID;
- Returns:
- the unique ID for the given option.
 
 - 
getTypeOptionType getType(java.lang.String optionName) Returns the OptionType of the given option.- Parameters:
- optionName- the name of the option for which to get the type.
- Returns:
- the OptionType of option with the given name.
 
 - 
getPropertyEditorjava.beans.PropertyEditor getPropertyEditor(java.lang.String optionName) Get the property editor for the option with the given name. Note: This method must be called from the swing thread.- Returns:
- either the PropertyEditor that was registered for this option or a default editor for the property type if one can be found; otherwise null.
 
 - 
getRegisteredPropertyEditorjava.beans.PropertyEditor getRegisteredPropertyEditor(java.lang.String optionName) Get the property editor that was registered for the specific option with the given name. Unlike the getPropertyEditor() method, this method does not have to be called from the swing thread- Returns:
- the PropertyEditor that was registered for this option.
 
 - 
getChildOptionsjava.util.List<Options> getChildOptions() Returns a list of Options objects that are nested one level down from this Options object.- Returns:
- a list of Options objects that are nested one level down from this Options object.
 
 - 
getLeafOptionNamesjava.util.List<java.lang.String> getLeafOptionNames() Returns a list of option names that immediately fall under this options. For example, if this options object had the following options named ("a", "b", "c.d"), only "a" and "b" would be returned. The "c.d" leaf option name could be returned by getOptions("c").getLeafOptionNames()- Returns:
- the list of the names of the options that are immediate children of this options object.
 
 - 
setOptionsHelpLocationvoid setOptionsHelpLocation(HelpLocation helpLocation) Set the location for where help can be found for this entire options object.- Parameters:
- helpLocation- location for help on the option
 
 - 
getOptionsHelpLocationHelpLocation getOptionsHelpLocation() Returns the HelpLocation for this entire Options object.- Returns:
- the HelpLocation for this entire Options object.
 
 - 
getHelpLocationHelpLocation getHelpLocation(java.lang.String optionName) Get the location for where help can be found for the option with the given name.- Parameters:
- optionName- name of the option
- Returns:
- null if the help location was not set on the option
 
 - 
registerOptionvoid registerOption(java.lang.String optionName, java.lang.Object defaultValue, HelpLocation help, java.lang.String description)Registers an option with a description, help location, and a default value without specifying the option type. This form requires that the default value not be null so that the option type can be inferred from the default value.- Parameters:
- optionName- the name of the option being registered.
- defaultValue- the defaultValue for the option. The default value must not be null so that the OptionType can be determined. If the default value should be null, use- registerOption(String, OptionType, Object, HelpLocation, String)
- help- the HelpLocation for this option.
- description- a description of the option.
- Throws:
- java.lang.IllegalArgumentException- if the defaultValue is null
 
 - 
registerOptionvoid registerOption(java.lang.String optionName, OptionType type, java.lang.Object defaultValue, HelpLocation help, java.lang.String description)Registers an option with a description, help location, and a optional default value. With an optional default value, an OptionType must be passed as it is otherwise derived from the default value.- Parameters:
- optionName- the name of the option being registered.
- type- the OptionType for this options.
- defaultValue- the defaultValue for the option. In this version of the method, the default value may be null.
- help- the HelpLocation for this option.
- description- a description of the option.
 
 - 
registerOptionvoid registerOption(java.lang.String optionName, OptionType type, java.lang.Object defaultValue, HelpLocation help, java.lang.String description, java.beans.PropertyEditor editor)Registers an option with a description, help location, and a optional default value. With an optional default value, an OptionType must be passed as it is otherwise derived from the default value.- Parameters:
- optionName- the name of the option being registered.
- type- the OptionType for this options.
- defaultValue- the defaultValue for the option. In this version of the method, the default value may be null.
- help- the HelpLocation for this option.
- description- a description of the option.
- editor- an optional custom editor for this property. Note if the option is a custom option, then the property editor can't be null;
- Throws:
- java.lang.IllegalStateException- if the options is a custom option and the editor is null.
 
 - 
registerOptionsEditorvoid registerOptionsEditor(OptionsEditor editor) Register the options editor that will handle the editing for all the options or a sub group of options.- Parameters:
- path- the path to the sub group of options or "" for all the options.
- editor- the custom editor panel to be used to edit the options or sub group of options.
 
 - 
getOptionsEditorOptionsEditor getOptionsEditor() Get the editor that will handle editing all the values in this options or sub group of options.- Parameters:
- path- the path to the sub group of options or "" for all the options.
- Returns:
- null if no options editor was registered
 
 - 
putObjectvoid putObject(java.lang.String optionName, java.lang.Object obj)Put the object value. If the option exists, the type must match the type of the existing object.- Throws:
- java.lang.IllegalStateException- if the object does not match the existing type of the option.
- java.lang.IllegalArgumentException- if the object is null or not a supported type.
 
 - 
getObjectjava.lang.Object getObject(java.lang.String optionName, java.lang.Object defaultValue)Get the object value; called when the options dialog is being populated.- Parameters:
- optionName- option name
- defaultValue- default value
- Returns:
- object with the given option name; if no option was found, return default value (this value is not stored in the option maps)
 
 - 
getBooleanboolean getBoolean(java.lang.String optionName, boolean defaultValue)Get the boolean value for the given option name.- Parameters:
- optionName- option name
- defaultValue- value that is stored and returned if there is no option with the given name.
- Returns:
- boolean option value
 
 - 
getByteArraybyte[] getByteArray(java.lang.String optionName, byte[] defaultValue)Get the byte array for the given option name.- Parameters:
- optionName- option name
- defaultValue- value that is stored and returned if there is no option with the given name
- Returns:
- byte[] byte array value
 
 - 
getIntint getInt(java.lang.String optionName, int defaultValue)Get the int value for the given option name.- Parameters:
- optionName- option name
- defaultValue- value that is stored and returned if there is no option with the given name
- Returns:
- int option value
 
 - 
getDoubledouble getDouble(java.lang.String optionName, double defaultValue)Get the double value for the given option name.- Parameters:
- optionName- option name
- defaultValue- value that is stored and returned if there is no option with the given name
- Returns:
- double value for the option
 
 - 
getFloatfloat getFloat(java.lang.String optionName, float defaultValue)Get the float value for the given option name.- Parameters:
- optionName- option name
- defaultValue- value that is stored and returned if there is no option with the given name
- Returns:
- float value for the option
 
 - 
getLonglong getLong(java.lang.String optionName, long defaultValue)Get the long value for the given option name.- Parameters:
- optionName- option name
- defaultValue- value that is stored and returned if there is no option with the given name
- Returns:
- long value for the option
 
 - 
getCustomOptionCustomOption getCustomOption(java.lang.String optionName, CustomOption defaultValue) Get the custom option value for the given option name.- Parameters:
- optionName- option name
- defaultValue- value that is stored and returned if there is no option with the given name
- Returns:
- WrappedOption value for the option
 
 - 
getColorjava.awt.Color getColor(java.lang.String optionName, java.awt.Color defaultValue)Get the Color for the given option name.- Parameters:
- optionName- option name
- defaultValue- value that is stored and returned if there is no option with the given name
- Returns:
- Color option
- Throws:
- java.lang.IllegalArgumentException- is a option exists with the given name but it is not a Color
 
 - 
getFilejava.io.File getFile(java.lang.String optionName, java.io.File defaultValue)Get the File for the given option name.- Parameters:
- optionName- option name
- defaultValue- value that is stored and returned if there is no option with the given name
- Returns:
- File option
- Throws:
- java.lang.IllegalArgumentException- is a option exists with the given name but it is not a File options
 
 - 
getDatejava.util.Date getDate(java.lang.String pName, java.util.Date date)Get the Date for the given option name.- Parameters:
- optionName- option name
- defaultValue- value that is stored and returned if there is no option with the given name
- Returns:
- the Date for the option
- Throws:
- java.lang.IllegalArgumentException- is a option exists with the given name but it is not a Date options
 
 - 
getFontjava.awt.Font getFont(java.lang.String optionName, java.awt.Font defaultValue)Get the Font for the given option name.- Parameters:
- optionName- option name
- defaultValue- value that is stored and returned if there is no option with the given name
- Returns:
- Font option
- Throws:
- java.lang.IllegalArgumentException- is a option exists with the given name but it is not a Font
 
 - 
getKeyStrokejavax.swing.KeyStroke getKeyStroke(java.lang.String optionName, javax.swing.KeyStroke defaultValue)Get the KeyStrokg for the given action name.- Parameters:
- optionName- the option name
- defaultValue- value that is stored and returned if there is no option with the given name
- Returns:
- KeyStroke option
- Throws:
- java.lang.IllegalArgumentException- is a option exists with the given name but it is not a KeyStroke
 
 - 
getStringjava.lang.String getString(java.lang.String optionName, java.lang.String defaultValue)Get the string value for the given option name.- Parameters:
- optionName- option name
- defaultValue- value that is stored and returned if there is no option with the given name
- Returns:
- String value for the option
 
 - 
getEnum<T extends java.lang.Enum<T>> T getEnum(java.lang.String optionName, T defaultValue)Get the Enum value for the given option name.- Parameters:
- optionName- option name
- defaultValue- default value that is stored and returned if there is no option with the given name
- Returns:
- Enum value for the option
 
 - 
setLongvoid setLong(java.lang.String optionName, long value)Sets the long value for the option.- Parameters:
- optionName- name of the option
- value- value of the option
 
 - 
setBooleanvoid setBoolean(java.lang.String optionName, boolean value)Sets the boolean value for the option.- Parameters:
- optionName- name of the option
- value- value of the option
 
 - 
setIntvoid setInt(java.lang.String optionName, int value)Sets the int value for the option.- Parameters:
- optionName- name of the option
- value- value of the option
 
 - 
setDoublevoid setDouble(java.lang.String optionName, double value)Sets the double value for the option.- Parameters:
- optionName- name of the option
- value- value of the option
 
 - 
setFloatvoid setFloat(java.lang.String optionName, float value)Sets the float value for the option.- Parameters:
- optionName- name of the option
- value- value of the option
 
 - 
setCustomOptionvoid setCustomOption(java.lang.String optionName, CustomOption value)Sets the Custom option value for the option.- Parameters:
- optionName- name of the option
- value-
 
 - 
setByteArrayvoid setByteArray(java.lang.String optionName, byte[] value)Sets the byte[] value for the given option name.- Parameters:
- optionName- the name of the option on which to save bytes.
- value-
 
 - 
setFilevoid setFile(java.lang.String optionName, java.io.File value)Sets the File value for the option.- Parameters:
- optionName- name of the option
- value-
 
 - 
setDatevoid setDate(java.lang.String optionName, java.util.Date newSetting)Sets the Date value for the option.- Parameters:
- optionName- name of the option
- value-
 
 - 
setColorvoid setColor(java.lang.String optionName, java.awt.Color value)Sets the Color value for the option- Parameters:
- optionName- name of the option
- value- Color to set
- Throws:
- java.lang.IllegalArgumentException- if a option with the given name already exists, but it is not a Color
 
 - 
setFontvoid setFont(java.lang.String optionName, java.awt.Font value)Sets the Font value for the option- Parameters:
- optionName- name of the option
- value- Font to set
- Throws:
- java.lang.IllegalArgumentException- if a option with the given name already exists, but it is not a Font
 
 - 
setKeyStrokevoid setKeyStroke(java.lang.String optionName, javax.swing.KeyStroke value)Sets the KeyStroke value for the option- Parameters:
- optionName- name of the option
- value- KeyStroke to set
- Throws:
- java.lang.IllegalArgumentException- if a option with the given name already exists, but it is not a KeyStroke
 
 - 
setStringvoid setString(java.lang.String optionName, java.lang.String value)Set the String value for the option.- Parameters:
- optionName- name of the option
- value- value of the option
 
 - 
setEnum<T extends java.lang.Enum<T>> void setEnum(java.lang.String optionName, T value)Set the Enum value for the option.- Parameters:
- optionName- name of the option
- value- Enum value of the option
 
 - 
removeOptionvoid removeOption(java.lang.String optionName) Remove the option name.- Parameters:
- optionName- name of option to remove
 
 - 
getOptionNamesjava.util.List<java.lang.String> getOptionNames() Get the list of option names. This method will return the names (paths) of all options contained in this options object or below. For example, if the options has ("aaa", "bbb", "ccc.ddd"), all three will be returned. thegetLeafOptionNames()method will return only the "aaa" and "bbb" names.- Returns:
- the list of all option names(paths) under this options.
 
 - 
containsboolean contains(java.lang.String optionName) Return true if a option exists with the given name.- Parameters:
- optionName- option name
 
 - 
getDescriptionjava.lang.String getDescription(java.lang.String optionName) Get the description for the given option name.- Parameters:
- optionName- name of the option
- Returns:
- null if the description or option name does not exist
 
 - 
isRegisteredboolean isRegistered(java.lang.String optionName) Returns true if the specified option has been registered. Only registered names are saved.
 - 
isDefaultValueboolean isDefaultValue(java.lang.String optionName) Returns true if the option with the given name's current value is the default value.- Parameters:
- optionName- the name of the option.
- Returns:
- true if the options has its current value equal to its default value.
 
 - 
restoreDefaultValuesvoid restoreDefaultValues() Restores all options contained herein to their default values.- See Also:
- restoreDefaultValue(String)
 
 - 
restoreDefaultValuevoid restoreDefaultValue(java.lang.String optionName) Restores the option denoted by the given name to its default value.- Parameters:
- optionName- The name of the option to restore
- See Also:
- restoreDefaultValues()
 
 - 
getOptionsOptions getOptions(java.lang.String path) Returns a Options object that is a sub-options of this options.- Parameters:
- path- the path for the sub-options object.
- Returns:
- a Options object that is a sub-options of this options.
 
 - 
createAliasvoid createAlias(java.lang.String aliasName, Options options, java.lang.String optionsName)Create an alias in this options for an existing option in some other options object.- Parameters:
- aliasName- the name within this options object that will acutally refer to some other options object.
- options- the options object that has the actual option.
- optionsName- the name within the given options object of the actual option.
 
 - 
isAliasboolean isAlias(java.lang.String aliasName) Returns- Parameters:
- aliasName- the name of the alias.
- Returns:
- a Options object that is a sub-options of this options.
 
 - 
getDefaultValuejava.lang.Object getDefaultValue(java.lang.String optionName) Returns the default value for the given option.- Parameters:
- optionName- the name of the option for which to retrieve the default value.
- Returns:
- the default value for the given option.
 
 - 
getValueAsStringjava.lang.String getValueAsString(java.lang.String name) Returns the value as a string for the given option.- Parameters:
- optionName- the name of the option for which to retrieve the value as a string
- Returns:
- the value as a string for the given option.
 
 - 
getDefaultValueAsStringjava.lang.String getDefaultValueAsString(java.lang.String analyzerName) Returns the default value as a string for the given option.- Parameters:
- optionName- the name of the option for which to retrieve the default value as a string
- Returns:
- the default value as a string for the given option.
 
 
- 
 
-