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
ConstructorsConstructorDescriptionProjectFileValue(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 andDomainObjectclass 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 DomainFilefromString(String valueString) Parses the given string into a value of type TReturns a JComponent for entering or editing a value of this type.protected Stringprotected voidUpdates the JComponent returned fromAbstractValue.getComponent()to represent the current value of this object.protected voidCauses 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 andDomainObjectclass 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- aDomainFileclass to filter on. (Only those types will appear in the chooser)
-
-
Method Details
-
getComponent
Description copied from class:AbstractValueReturns a JComponent for entering or editing a value of this type.- Specified by:
getComponentin classAbstractValue<DomainFile>- Returns:
- a JComponent for entering or editing a value of this type.
-
updateValueFromComponent
Description copied from class:AbstractValueCauses the stored value for this object to be updated based on the state of the JComponent returned fromAbstractValue.getComponent()- Specified by:
updateValueFromComponentin 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:AbstractValueUpdates the JComponent returned fromAbstractValue.getComponent()to represent the current value of this object.- Specified by:
updateComponentFromValuein classAbstractValue<DomainFile>
-
fromString
Description copied from class:AbstractValueParses the given string into a value of type T- Specified by:
fromStringin classAbstractValue<DomainFile>- Parameters:
valueString- the string to parse- Returns:
- a value of type T
-
toString
- Overrides:
toStringin classAbstractValue<DomainFile>
-