Package ghidra.app.util.viewer.format
Class FormatManager
java.lang.Object
ghidra.app.util.viewer.format.FormatManager
- All Implemented Interfaces:
OptionsChangeListener
Class to manage the set of format models.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionFormatManager
(ToolOptions displayOptions, ToolOptions fieldOptions) Constructs a new FormatManager. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addFormatModelListener
(FormatModelListener listener) Adds a listener to be notified when a format changes.void
addHighlightProvider
(ListingHighlightProvider provider) Adds a HighlightProvidervoid
dispose()
Returns the format model for a code unit.Returns the Options used for display properties.Returns the format model for the address break (divider).Returns the Options used for field specific properties.Returns theListingHighlightProvider
that should be used when creatingFieldFactory
objects.Returns the format model for the function signature.Returns the format model for the function variables.Gets allListingHighlightProvider
s installed on this FormatManager via theaddHighlightProvider(ListingHighlightProvider)
.int
Returns the maximum number of possible rows in a layout.int
int
Returns the width of the widest model in this manager.getModel
(int index) Returns the format model for the given index.int
Returns the total number of model in the format manager.getOpenDataFormat
(Data data) Returns the format model to use for the internals of open structures.Returns the format model for the plate field.Returns the template simplifier.void
modelChanged
(FieldFormatModel model) Notifies listeners that the given model has changed.void
optionsChanged
(ToolOptions options, String name, Object oldValue, Object newValue) Notification that an option changed.void
Restores the state of this LayoutController from the given SaveState object.void
removeFormatModleListener
(FormatModelListener listener) Removes the given listener from the list of listeners to be notified of a format change.void
Removes the providervoid
Saves the state of this LayoutManager to the SaveState object.void
setDefaultFormat
(int modelID) Resets the model with the given id to its default format.void
Resets all format models to their default format.void
setServiceProvider
(ServiceProvider provider) Sets the service provider used by the field factory objects.void
update()
update all listeners that a model has changed.
-
Field Details
-
ARRAY_OPTIONS_GROUP
- See Also:
-
HIGHLIGHT_COLOR_NAME
- See Also:
-
HIGHLIGHT_ALT_COLOR_NAME
- See Also:
-
ARRAY_DISPLAY_OPTIONS
- See Also:
-
ARRAY_DISPLAY_DESCRIPTION
- See Also:
-
-
Constructor Details
-
FormatManager
Constructs a new FormatManager.- Parameters:
displayOptions
- the Options containing display options (color, fonts, etc)fieldOptions
- the Options contains specific field options.
-
-
Method Details
-
createClone
-
dispose
public void dispose() -
setServiceProvider
Sets the service provider used by the field factory objects.- Parameters:
provider
- the service provider
-
addFormatModelListener
Adds a listener to be notified when a format changes.- Parameters:
listener
- the listener to be added
-
removeFormatModleListener
Removes the given listener from the list of listeners to be notified of a format change.- Parameters:
listener
- the listener to be removed.
-
getNumModels
public int getNumModels()Returns the total number of model in the format manager.- Returns:
- the total number of model in the format manager
-
getModel
Returns the format model for the given index.- Parameters:
index
- the index of the format model to return.- Returns:
- the format model for the given index
-
getDividerModel
Returns the format model for the address break (divider).- Returns:
- the format model for the address break (divider)
-
getPlateFormat
Returns the format model for the plate field.- Returns:
- the format model for the plate field
-
getFunctionFormat
Returns the format model for the function signature.- Returns:
- the format model for the function signature
-
getFunctionVarFormat
Returns the format model for the function variables.- Returns:
- the format model for the function variables
-
getCodeUnitFormat
Returns the format model for a code unit.- Returns:
- the format model for a code unit
-
getOpenDataFormat
Returns the format model to use for the internals of open structures.- Parameters:
data
- the data code unit to get the format model for.
-
update
public void update()update all listeners that a model has changed. -
getDisplayOptions
Returns the Options used for display properties.- Returns:
- the Options used for display properties.
-
getFieldOptions
Returns the Options used for field specific properties.- Returns:
- the Options used for field specific properties
-
getTemplateSimplifier
Returns the template simplifier.- Returns:
- the template simplifier.
-
modelChanged
Notifies listeners that the given model has changed.- Parameters:
model
- the format model that changed.
-
getMaxWidth
public int getMaxWidth()Returns the width of the widest model in this manager. -
getMaxRowCount
public int getMaxRowCount() -
getMaxNumRows
public int getMaxNumRows()Returns the maximum number of possible rows in a layout. This would only occur if some address had every possible type of information to be displayed. -
setDefaultFormat
public void setDefaultFormat(int modelID) Resets the model with the given id to its default format.- Parameters:
modelID
- the id of the model to reset.
-
setDefaultFormats
public void setDefaultFormats()Resets all format models to their default format. -
addHighlightProvider
Adds a HighlightProvider- Parameters:
provider
- the provider to use.- See Also:
-
removeHighlightProvider
Removes the provider- Parameters:
provider
- the provider to remove.- See Also:
-
getHighlightProviders
Gets allListingHighlightProvider
s installed on this FormatManager via theaddHighlightProvider(ListingHighlightProvider)
.- Returns:
- all
ListingHighlightProvider
s installed on this FormatManager.
-
getFormatHighlightProvider
Returns theListingHighlightProvider
that should be used when creatingFieldFactory
objects. -
optionsChanged
Description copied from interface:OptionsChangeListener
Notification that an option changed.Note: to reject an options change, you can throw a
OptionsVetoException
.- Specified by:
optionsChanged
in interfaceOptionsChangeListener
- Parameters:
options
- options object containing the property that changedname
- name of option that changedoldValue
- old value of the optionnewValue
- new value of the option
-
saveState
Saves the state of this LayoutManager to the SaveState object.- Parameters:
saveState
- the SaveState object to write to.
-
readState
Restores the state of this LayoutController from the given SaveState object.- Parameters:
saveState
- the SaveState to read from.
-
getServiceProvider
-