Package ghidra.features.base.values
Class AddressValue
Value class for
Address
types. In order to parse and create Address types, an
AddressFactory
is required when defining this type. As a convenience, it can
be constructed with a Program
, in which case it will use the AddressFactory from
that program.
This class and other subclasses of AbstractValue
are part of a subsystem for easily
defining a set of values that can be displayed in an input dialog (ValuesMapDialog
).
Typically, these values are created indirectly using a GValuesMap
which is then
given to the constructor of the dialog. However, an alternate approach is to create the
dialog without a ValuesMap and then use its ValuesMapDialog.addValue(AbstractValue)
method directly.
-
Constructor Summary
ConstructorDescriptionAddressValue
(String name, Address defaultValue, AddressFactory factory) Creates an AddressValue with an optional default value.AddressValue
(String name, Address defaultValue, Program program) Creates an AddressValue with an optional default value and uses theAddressFactory
from the given program. -
Method Summary
Modifier and TypeMethodDescriptionprotected Address
fromString
(String valueString) Parses the given string into a value of type TReturns a JComponent for entering or editing a value of this type.protected void
Updates the JComponent returned fromAbstractValue.getComponent()
to represent the current value of this object.protected void
Causes the stored value for this object to be updated based on the state of the JComponent returned fromAbstractValue.getComponent()
-
Constructor Details
-
AddressValue
Creates an AddressValue with an optional default value and uses theAddressFactory
from the given program.- Parameters:
name
- the name of this valuedefaultValue
- an optional default valueprogram
- the program whose AddressFactory will be used to create Addresses.
-
AddressValue
Creates an AddressValue with an optional default value.- Parameters:
name
- the name of this valuedefaultValue
- an optional default valuefactory
- the AddressFactory that will be used to create Addresses.
-
-
Method Details
-
getComponent
Description copied from class:AbstractValue
Returns a JComponent for entering or editing a value of this type.- Specified by:
getComponent
in classAbstractValue<Address>
- Returns:
- a JComponent for entering or editing a value of this type.
-
updateValueFromComponent
Description copied from class:AbstractValue
Causes the stored value for this object to be updated based on the state of the JComponent returned fromAbstractValue.getComponent()
- Specified by:
updateValueFromComponent
in classAbstractValue<Address>
- Throws:
ValuesMapParseException
- if an error occurs trying update the value from a component. This usually is a result of trying to parse a string value.
-
updateComponentFromValue
protected void updateComponentFromValue()Description copied from class:AbstractValue
Updates the JComponent returned fromAbstractValue.getComponent()
to represent the current value of this object.- Specified by:
updateComponentFromValue
in classAbstractValue<Address>
-
fromString
Description copied from class:AbstractValue
Parses the given string into a value of type T- Specified by:
fromString
in classAbstractValue<Address>
- Parameters:
valueString
- the string to parse- Returns:
- a value of type T
-