Package ghidra.app.util.viewer.field
Interface AnnotatedStringHandler
- All Superinterfaces:
ExtensionPoint
- All Known Implementing Classes:
AddressAnnotatedStringHandler
,ExecutableTaskStringHandler
,GhidraLocalURLAnnotatedStringHandler
,GhidraServerURLAnnotatedStringHandler
,InvalidAnnotatedStringHandler
,ProgramAnnotatedStringHandler
,SymbolAnnotatedStringHandler
,URLAnnotatedStringHandler
NOTE: ALL AnnotatedStringHandler CLASSES MUST END IN "StringHandler". If not,
the ClassSearcher will not find them.
An interface that describes a string that has been annotated, which allows for adding
rendering and functionality to strings.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateAnnotatedString
(AttributedString prototypeString, String[] text, Program program) Creates anFieldElement
based upon the give array of Strings.static String
Escape a string that is intended to be used as a annotated string portion.Returns the String that represents the GUI presence of this optionReturns an example string of how the annotation is useddefault String
getPrototypeString
(String displayText) Returns an example string of how the annotation is usedString[]
Returns the annotation string names that this AnnotatedStringHandler supports (e.g., "symbol", "address", etc...).boolean
handleMouseClick
(String[] annotationParts, Navigatable sourceNavigatable, ServiceProvider serviceProvider) A method that is notified when an annotation is clicked.
-
Field Details
-
DUMMY_MOUSE_HANDLER
-
-
Method Details
-
escapeAnnotationPart
Escape a string that is intended to be used as a annotated string portion.Quotes are escaped, '}' and ' ' are placed inside quotes.
- Parameters:
s
- string to escape- Returns:
- escaped string
-
createAnnotatedString
AttributedString createAnnotatedString(AttributedString prototypeString, String[] text, Program program) throws AnnotationException Creates anFieldElement
based 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.- Parameters:
prototypeString
- The prototypeFieldElement
that dictates the attributes for the newly created string. Implementations may change attributes as needed.text
- An array of Strings used to create theFieldElement
being returned.program
- The program with which the returned string is associated.- Returns:
- An
AnnotatedTextFieldElement
that 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.
-
getSupportedAnnotations
String[] getSupportedAnnotations()Returns the annotation string names that this AnnotatedStringHandler supports (e.g., "symbol", "address", etc...).- Returns:
- the annotation string names that this AnnotatedStringHandler supports.
-
getDisplayString
String getDisplayString()Returns the String that represents the GUI presence of this option- Returns:
- the String to display in GUI components.
-
getPrototypeString
String getPrototypeString()Returns an example string of how the annotation is used- Returns:
- the example of how this is used.
-
getPrototypeString
Returns an example string of how the annotation is used- Parameters:
displayText
- The text that may be wrapped, cannot be null- Returns:
- the example of how this is used.
-