Package ghidra.app.util.viewer.field
Class EolCommentFieldFactory
java.lang.Object
ghidra.app.util.viewer.field.FieldFactory
ghidra.app.util.viewer.field.EolCommentFieldFactory
- All Implemented Interfaces:
ExtensionPoint
Generates End of line comment Fields.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Colorstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class ghidra.app.util.viewer.field.FieldFactory
BASE_LISTING_FONT_ID, baseFont, colorOptionName, enabled, FONT_OPTION_NAME, hlProvider, model, name, startX, style, styleOptionName, width -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptsType(int category, Class<?> proxyObjectClass) Used to specify which format models this field can belong to.voiddisplayOptionsChanged(Options options, String optionName, Object oldValue, Object newValue) Notifications that the display options changed.voidfieldOptionsChanged(Options options, String optionName, Object oldValue, Object newValue) Notification that an option changed.Generates a Field based on the given information.getFieldLocation(ListingField bf, BigInteger index, int fieldNum, ProgramLocation loc) Return a FieldLocation that corresponds to the given index, fieldNum, and ProgramLocation IF and ONLY IF the given programLocation is the type generated by this class'sFieldFactory.getFieldLocation(ListingField, BigInteger, int, ProgramLocation).getProgramLocation(int screenRow, int screenColumn, ListingField bf) Returns the Program location for the given object, row, col, and groupPathstatic StringgetSingleString(String[] comments, char separatorChar) Convert the array of comments to a single string and use the given separatorChar as the delimiter.newInstance(FieldFormatModel fieldFormatModel, ListingHighlightProvider highlightProvider, ToolOptions newDisplayOptions, ToolOptions newFieldOptions) Returns a new instance of this FieldFactory that can be used to generate fields instead of being used as a prototype.Methods inherited from class ghidra.app.util.viewer.field.FieldFactory
getFieldModel, getFieldName, getFieldText, getMetrics, getMetrics, getStartX, getWidth, hasSamePath, initDisplayOptions, initFieldOptions, isEnabled, servicesChanged, setEnabled, setStartX, setWidth, simplifyTemplates, supportsLocation
-
Field Details
-
FIELD_NAME
- See Also:
-
ENABLE_WORD_WRAP_KEY
- See Also:
-
MAX_DISPLAY_LINES_KEY
- See Also:
-
ENABLE_SHOW_SEMICOLON_KEY
- See Also:
-
ENABLE_PREPEND_REF_ADDRESS_KEY
- See Also:
-
EXTRA_COMMENT_KEY
- See Also:
-
DEFAULT_COLOR
-
-
Constructor Details
-
EolCommentFieldFactory
public EolCommentFieldFactory()Default Constructor
-
-
Method Details
-
fieldOptionsChanged
public void fieldOptionsChanged(Options options, String optionName, Object oldValue, Object newValue) Notification that an option changed.- Overrides:
fieldOptionsChangedin classFieldFactory- Parameters:
options- options object containing the property that changedoptionName- name of option that changedoldValue- old value of the optionnewValue- new value of the option
-
displayOptionsChanged
public void displayOptionsChanged(Options options, String optionName, Object oldValue, Object newValue) Description copied from class:FieldFactoryNotifications that the display options changed.- Overrides:
displayOptionsChangedin classFieldFactory- Parameters:
options- the Display Options object that changed.optionName- the name of the property that changed.oldValue- the old value of the property.newValue- the new value of the property.
-
getField
Description copied from class:FieldFactoryGenerates a Field based on the given information.- Specified by:
getFieldin classFieldFactory- Parameters:
proxy- The object that the generated field will report some information about.varWidth- the additional distance along the x axis to place the generated field.- Returns:
- the newly generated FactoryField that shows some property or information about the given object.
-
getProgramLocation
Description copied from class:FieldFactoryReturns the Program location for the given object, row, col, and groupPath- Specified by:
getProgramLocationin classFieldFactory- Parameters:
screenRow- the row location for the cursor within the listing field.screenColumn- the column location for the cursor within the listing field.bf- the listing field.- Returns:
- the program location that is equivalent to the cursor location in the field.
-
getFieldLocation
public FieldLocation getFieldLocation(ListingField bf, BigInteger index, int fieldNum, ProgramLocation loc) Description copied from class:FieldFactoryReturn a FieldLocation that corresponds to the given index, fieldNum, and ProgramLocation IF and ONLY IF the given programLocation is the type generated by this class'sFieldFactory.getFieldLocation(ListingField, BigInteger, int, ProgramLocation). Each FieldFactory should generate and process a unique ProgramLocation class.- Specified by:
getFieldLocationin classFieldFactory- Parameters:
bf- the ListingField at the current cursor.index- the line index (corresponds to an address)fieldNum- the index of field within the layout to try and get a FieldLocation.loc- the ProgramLocation to be converted into a FieldLocation.- Returns:
- the location.
-
acceptsType
Description copied from class:FieldFactoryUsed to specify which format models this field can belong to.- Specified by:
acceptsTypein classFieldFactory- Parameters:
category- the category for this fieldproxyObjectClass- the type of proxy object used by this field- Returns:
- true if this class accepts the given category.
-
newInstance
public FieldFactory newInstance(FieldFormatModel fieldFormatModel, ListingHighlightProvider highlightProvider, ToolOptions newDisplayOptions, ToolOptions newFieldOptions) Description copied from class:FieldFactoryReturns a new instance of this FieldFactory that can be used to generate fields instead of being used as a prototype.- Specified by:
newInstancein classFieldFactory- Parameters:
fieldFormatModel- the model that the field belongs to.highlightProvider- the HightLightProvider.newDisplayOptions- the Options for display properties.newFieldOptions- the Options for field specific properties.- Returns:
- the factory
-
getSingleString
Convert the array of comments to a single string and use the given separatorChar as the delimiter.- Parameters:
comments- array of comments to convertseparatorChar- character to insert after each element in the comment array- Returns:
- the converted string
-