Package ghidra.app.util.html
Class HTMLDataTypeRepresentation
java.lang.Object
ghidra.app.util.html.HTMLDataTypeRepresentation
- Direct Known Subclasses:
ArrayDataTypeHTMLRepresentation
,BitFieldDataTypeHTMLRepresentation
,CompletelyDifferentHTMLDataTypeRepresentationWrapper
,CompositeDataTypeHTMLRepresentation
,DefaultDataTypeHTMLRepresentation
,EnumDataTypeHTMLRepresentation
,FunctionDataTypeHTMLRepresentation
,MissingArchiveDataTypeHTMLRepresentation
,NullDataTypeHTMLRepresentation
,PointerDataTypeHTMLRepresentation
,TypeDefDataTypeHTMLRepresentation
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
protected static final String
protected static final String
protected static final Color
protected static final String
protected static final String
HACK: for some reason when opening the HTML document with '/', all text until the next HTML tag is not displayed.protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final int
protected static final int
protected static final int
protected static final String
protected String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
-
Constructor Summary
ModifierConstructorDescriptionprotected
Default constructor for those who promise to later set the HTML textprotected
HTMLDataTypeRepresentation
(String htmlText) -
Method Summary
Modifier and TypeMethodDescriptionprotected static StringBuilder
addDataTypeLength
(String dataTypeLengthString, StringBuilder buffer) protected static StringBuilder
addDataTypeLengthAndAlignment
(DataType dt, StringBuilder buffer) protected TextLine
buildFooterText
(DataType dataType) protected List
<ValidatableLine> buildHeaderText
(DataType dataType) protected HTMLDataTypeRepresentation[]
protected List
<ValidatableLine> copyLines
(List<ValidatableLine> lines) createCommentLines
(String comment, int maxLines) Formats a multi-line plain-text comment as a list of HTML marked-up lines.protected PlaceHolderLine
createPlaceHolderLine
(ValidatableLine oppositeLine) Extension point for adding empty lines.abstract HTMLDataTypeRepresentation[]
diff
(HTMLDataTypeRepresentation otherRepresentation) Compares this representation and the given representation creates a diff string for both representations.protected void
diffTextLine
(TextLine textLine, TextLine otherTextLine) protected static String
generateTypeName
(DataType dt, Color color, boolean trim) protected static String
getCommentForDataType
(DataType dataType) Returns the plain-text value of the data type's description.protected static String
protected HTMLDataTypeRepresentationDiffInput
getDiffInput
(ValidatableLine line) protected HTMLDataTypeRepresentationDiffInput
getDiffInput
(List<ValidatableLine> lines) This is likegetHTMLString()
, but does not put HTML tags around the dataReturns an HTML string for this data representation objectThis is likegetHTMLString()
, but does not put HTML tags around the dataReturns an HTML string for this data representation object.protected static String
truncateAsNecessary
(String string) protected static String
truncateAsNecessary
(String string, int length) protected static String
wrapStringInColor
(String string, Color color)
-
Field Details
-
EMPTY_TAG
HACK: for some reason when opening the HTML document with '/', all text until the next HTML tag is not displayed. So, we put in a dummy tag and all is well. Java 1.5.0_12- See Also:
-
MAX_COMPONENTS
protected static final int MAX_COMPONENTS- See Also:
-
MAX_CHARACTER_LENGTH
protected static final int MAX_CHARACTER_LENGTH- See Also:
-
MAX_LINE_LENGTH
protected static final int MAX_LINE_LENGTH- See Also:
-
HTML_OPEN
- See Also:
-
HTML_CLOSE
- See Also:
-
HTML_SPACE
- See Also:
-
CHARACTER_SPACE
- See Also:
-
TAB
-
BR
- See Also:
-
TABLE_OPEN
- See Also:
-
TABLE_CLOSE
- See Also:
-
TR_OPEN
- See Also:
-
TR_CLOSE
- See Also:
-
TD_OPEN
- See Also:
-
TD_CLOSE
- See Also:
-
TT_OPEN
- See Also:
-
TT_CLOSE
- See Also:
-
INDENT_OPEN
- See Also:
-
INDENT_CLOSE
- See Also:
-
ELLIPSES
- See Also:
-
LENGTH_PREFIX
- See Also:
-
ALIGNMENT_PREFIX
- See Also:
-
FORWARD_SLASH
- See Also:
-
START_COMMENT
- See Also:
-
MIDDLE_COMMENT
- See Also:
-
END_COMMENT
- See Also:
-
DIFF_COLOR
-
originalHTMLData
-
-
Constructor Details
-
HTMLDataTypeRepresentation
protected HTMLDataTypeRepresentation()Default constructor for those who promise to later set the HTML text -
HTMLDataTypeRepresentation
-
-
Method Details
-
addDataTypeLength
-
addDataTypeLengthAndAlignment
-
getDataTypeLengthString
-
getCommentForDataType
Returns the plain-text value of the data type's description.If there were html tags in the string, they are escaped.
- Parameters:
dataType
- the type to get the description / comment for- Returns:
- plain-text string, w/html escaped
-
truncateAsNecessary
-
truncateAsNecessary
-
wrapStringInColor
-
createCommentLines
Formats a multi-line plain-text comment as a list of HTML marked-up lines.- Parameters:
comment
- multi-line plain-text stringmaxLines
- max number of formatted lines to return- Returns:
- list of html marked-up
TextLine
s
-
getHTMLString
Returns an HTML string for this data representation object. The HTML returned will be truncated if it is too long. To get the full HTML, callgetFullHTMLString()
.- Returns:
- the html
- See Also:
-
getFullHTMLString
Returns an HTML string for this data representation object- Returns:
- the html
- See Also:
-
getHTMLContentString
This is likegetHTMLString()
, but does not put HTML tags around the data- Returns:
- the content
-
getFullHTMLContentString
This is likegetHTMLString()
, but does not put HTML tags around the data- Returns:
- the content
-
diff
Compares this representation and the given representation creates a diff string for both representations.- Parameters:
otherRepresentation
- the other representation to diff against.- Returns:
- An array of two strings: the first is this object's diff value, the second is the given objects diff value.
-
buildHeaderText
-
generateTypeName
-
getDiffInput
-
getDiffInput
-
completelyDifferentDiff
-
copyLines
-
diffTextLine
-
createPlaceHolderLine
Extension point for adding empty lines. Subclasses that do not wish to use the default empty text line can override this method.- Parameters:
oppositeLine
- the line that will go along with the newly created placeholder line- Returns:
- the placeholder line
-