Package ghidra.app.util.viewer.field
Class ProgramAnnotatedStringHandler
- java.lang.Object
- 
- ghidra.app.util.viewer.field.ProgramAnnotatedStringHandler
 
- 
- All Implemented Interfaces:
- AnnotatedStringHandler,- ExtensionPoint
 
 public class ProgramAnnotatedStringHandler extends java.lang.Object implements AnnotatedStringHandler An annotated string handler that allows handles annotations that begin withSUPPORTED_ANNOTATIONS. This class expects one string following the annotation text that is the program name. The display text will be that of the program name.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface ghidra.util.classfinder.ExtensionPointExtensionPoint.Exclude, ExtensionPoint.Util
 
- 
 - 
Field Summary- 
Fields inherited from interface ghidra.app.util.viewer.field.AnnotatedStringHandlerDUMMY_MOUSE_HANDLER
 
- 
 - 
Constructor SummaryConstructors Constructor Description ProgramAnnotatedStringHandler()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description AttributedStringcreateAnnotatedString(AttributedString prototypeString, java.lang.String[] text, Program program)Creates anFieldElementbased upon the give array of Strings.java.lang.StringgetDisplayString()Returns the String that represents the GUI presence of this optionjava.lang.StringgetPrototypeString()Returns an example string of how the annotation is usedjava.lang.String[]getSupportedAnnotations()Returns the annotation string names that this AnnotatedStringHandler supports (e.g., "symbol", "address", etc...).booleanhandleMouseClick(java.lang.String[] annotationParts, Navigatable navigatable, ServiceProvider serviceProvider)A method that is notified when an annotation is clicked.
 
- 
- 
- 
Method Detail- 
createAnnotatedStringpublic AttributedString createAnnotatedString(AttributedString prototypeString, java.lang.String[] text, Program program) throws AnnotationException Description copied from interface:AnnotatedStringHandlerCreates anFieldElementbased upon the give array of Strings. The first String in the list is expected to be the annotation tag used to create the annotation. At the very least the array is expected to be comprised of two elements, the annotation and some data. Extra data may be provided as needed by implementing classes.- Specified by:
- createAnnotatedStringin interface- AnnotatedStringHandler
- Parameters:
- prototypeString- The prototype- FieldElementthat dictates the attributes for the newly created string. Implementations may change attributes as needed.
- text- An array of Strings used to create the- FieldElementbeing returned.
- program- The program with which the returned string is associated.
- Returns:
- An AnnotatedTextFieldElementthat will be used to render the given text.
- Throws:
- AnnotationException- if the given text data does not fit the expected format for the given handler implementation.
 
 - 
getSupportedAnnotationspublic java.lang.String[] getSupportedAnnotations() Description copied from interface:AnnotatedStringHandlerReturns the annotation string names that this AnnotatedStringHandler supports (e.g., "symbol", "address", etc...).- Specified by:
- getSupportedAnnotationsin interface- AnnotatedStringHandler
- Returns:
- the annotation string names that this AnnotatedStringHandler supports.
 
 - 
handleMouseClickpublic boolean handleMouseClick(java.lang.String[] annotationParts, Navigatable navigatable, ServiceProvider serviceProvider)Description copied from interface:AnnotatedStringHandlerA method that is notified when an annotation is clicked. Returns true if this annotation handles the click; return false if this annotation does not do anything with the click.- Specified by:
- handleMouseClickin interface- AnnotatedStringHandler
- Parameters:
- annotationParts- The constituent parts of the annotation
- navigatable- The location in the program that was clicked.
- serviceProvider- A service provider for needed services.
- Returns:
- true if this annotation handles the click; return false if this annotation does not do anything with the click.
 
 - 
getDisplayStringpublic java.lang.String getDisplayString() Description copied from interface:AnnotatedStringHandlerReturns the String that represents the GUI presence of this option- Specified by:
- getDisplayStringin interface- AnnotatedStringHandler
- Returns:
- the String to display in GUI components.
 
 - 
getPrototypeStringpublic java.lang.String getPrototypeString() Description copied from interface:AnnotatedStringHandlerReturns an example string of how the annotation is used- Specified by:
- getPrototypeStringin interface- AnnotatedStringHandler
- Returns:
- the example of how this is used.
 
 
- 
 
-