Package ghidra.features.base.values
Class ProjectFileValue
- Direct Known Subclasses:
ProgramFileValue
Value class for project files (
DomainFile
). The editor component consists of a
JTextField
and a browse button for bringing up a DataTreeDialog
for picking
project files from the current project.
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
ConstructorDescriptionProjectFileValue
(String name) Constructor for creating a new ProjectFileValue with the given name.ProjectFileValue
(String name, Project project, String startingPath, Class<? extends DomainObject> projectFileClass) Constructor for ProgramValue when wanting to pick from a different project than the active project, such as a read-only project.ProjectFileValue
(String name, Class<? extends DomainObject> projectFileClass) Constructor for creating a new ProgramFileValue with the given name andDomainObject
class to filter on (All other types will be filtered out in the chooser).ProjectFileValue
(String name, String startingPath) Constructor for creating a new ProjectFileValue with the given name and a starting folder when using the project file chooser. -
Method Summary
Modifier and TypeMethodDescriptionprotected DomainFile
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 String
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
-
ProjectFileValue
Constructor for creating a new ProjectFileValue with the given name.- Parameters:
name
- the name of the value
-
ProjectFileValue
Constructor for creating a new ProgramFileValue with the given name andDomainObject
class to filter on (All other types will be filtered out in the chooser).- Parameters:
name
- the name of the valueprojectFileClass
- the DomainObject class to filter
-
ProjectFileValue
Constructor for creating a new ProjectFileValue with the given name and a starting folder when using the project file chooser.- Parameters:
name
- the name of the valuestartingPath
- the path to a starting folder
-
ProjectFileValue
public ProjectFileValue(String name, Project project, String startingPath, Class<? extends DomainObject> projectFileClass) Constructor for ProgramValue when wanting to pick from a different project than the active project, such as a read-only project.- Parameters:
name
- the name of the valueproject
- The project from which to pick a project.startingPath
- the path to a starting folder (Can also be a path to program)projectFileClass
- aDomainFile
class to filter on. (Only those types will appear in the chooser)
-
-
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<DomainFile>
- 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<DomainFile>
- 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<DomainFile>
-
fromString
Description copied from class:AbstractValue
Parses the given string into a value of type T- Specified by:
fromString
in classAbstractValue<DomainFile>
- Parameters:
valueString
- the string to parse- Returns:
- a value of type T
-
toString
- Overrides:
toString
in classAbstractValue<DomainFile>
-