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`

public abstract class HTMLDataTypeRepresentation extends Object

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected static final String`
  `ALIGNMENT_PREFIX`
  `protected static final String`
  `BR`
  `protected static final String`
  `CHARACTER_SPACE`
  `protected static final Color`
  `DIFF_COLOR`
  `protected static final String`
  `ELLIPSES`
  `protected static final String`
  `EMPTY_TAG`
  HACK: for some reason when opening the HTML document with '/', all text until the next HTML tag is not displayed.
  `protected static final String`
  `END_COMMENT`
  `protected static final String`
  `FORWARD_SLASH`
  `protected static final String`
  `HTML_CLOSE`
  `protected static final String`
  `HTML_OPEN`
  `protected static final String`
  `HTML_SPACE`
  `protected static final String`
  `INDENT_CLOSE`
  `protected static final String`
  `INDENT_OPEN`
  `protected static final String`
  `LENGTH_PREFIX`
  `protected static final int`
  `MAX_CHARACTER_LENGTH`
  `protected static final int`
  `MAX_COMPONENTS`
  `protected static final int`
  `MAX_LINE_LENGTH`
  `protected static final String`
  `MIDDLE_COMMENT`
  `protected String`
  `originalHTMLData`
  `protected static final String`
  `START_COMMENT`
  `protected static final String`
  `TAB`
  `protected static final String`
  `TABLE_CLOSE`
  `protected static final String`
  `TABLE_OPEN`
  `protected static final String`
  `TD_CLOSE`
  `protected static final String`
  `TD_OPEN`
  `protected static final String`
  `TR_CLOSE`
  `protected static final String`
  `TR_OPEN`
  `protected static final String`
  `TT_CLOSE`
  `protected static final String`
  `TT_OPEN`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `HTMLDataTypeRepresentation()`
  Default constructor for those who promise to later set the HTML text
  `protected`
  `HTMLDataTypeRepresentation(String htmlText)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected 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[]`
  `completelyDifferentDiff(HTMLDataTypeRepresentation other)`
  `protected List<ValidatableLine>`
  `copyLines(List<ValidatableLine> lines)`
  `protected static List<TextLine>`
  `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`
  `getDataTypeLengthString(DataType dt)`
  `protected HTMLDataTypeRepresentationDiffInput`
  `getDiffInput(ValidatableLine line)`
  `protected HTMLDataTypeRepresentationDiffInput`
  `getDiffInput(List<ValidatableLine> lines)`
  `String`
  `getFullHTMLContentString()`
  This is like `getHTMLString()`, but does not put HTML tags around the data
  `String`
  `getFullHTMLString()`
  Returns an HTML string for this data representation object
  `String`
  `getHTMLContentString()`
  This is like `getHTMLString()`, but does not put HTML tags around the data
  `String`
  `getHTMLString()`
  Returns 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)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### EMPTY_TAG

    protected static final String 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:
      - Constant Field Values

  - ### MAX_COMPONENTS

    protected static final int MAX_COMPONENTS
    See Also:
      - Constant Field Values

  - ### MAX_CHARACTER_LENGTH

    protected static final int MAX_CHARACTER_LENGTH
    See Also:
      - Constant Field Values

  - ### MAX_LINE_LENGTH

    protected static final int MAX_LINE_LENGTH
    See Also:
      - Constant Field Values

  - ### HTML_OPEN

    protected static final String HTML_OPEN
    See Also:
      - Constant Field Values

  - ### HTML_CLOSE

    protected static final String HTML_CLOSE
    See Also:
      - Constant Field Values

  - ### HTML_SPACE

    protected static final String HTML_SPACE
    See Also:
      - Constant Field Values

  - ### CHARACTER_SPACE

    protected static final String CHARACTER_SPACE
    See Also:
      - Constant Field Values

  - ### TAB

    protected static final String TAB

  - ### BR

    protected static final String BR
    See Also:
      - Constant Field Values

  - ### TABLE_OPEN

    protected static final String TABLE_OPEN
    See Also:
      - Constant Field Values

  - ### TABLE_CLOSE

    protected static final String TABLE_CLOSE
    See Also:
      - Constant Field Values

  - ### TR_OPEN

    protected static final String TR_OPEN
    See Also:
      - Constant Field Values

  - ### TR_CLOSE

    protected static final String TR_CLOSE
    See Also:
      - Constant Field Values

  - ### TD_OPEN

    protected static final String TD_OPEN
    See Also:
      - Constant Field Values

  - ### TD_CLOSE

    protected static final String TD_CLOSE
    See Also:
      - Constant Field Values

  - ### TT_OPEN

    protected static final String TT_OPEN
    See Also:
      - Constant Field Values

  - ### TT_CLOSE

    protected static final String TT_CLOSE
    See Also:
      - Constant Field Values

  - ### INDENT_OPEN

    protected static final String INDENT_OPEN
    See Also:
      - Constant Field Values

  - ### INDENT_CLOSE

    protected static final String INDENT_CLOSE
    See Also:
      - Constant Field Values

  - ### ELLIPSES

    protected static final String ELLIPSES
    See Also:
      - Constant Field Values

  - ### LENGTH_PREFIX

    protected static final String LENGTH_PREFIX
    See Also:
      - Constant Field Values

  - ### ALIGNMENT_PREFIX

    protected static final String ALIGNMENT_PREFIX
    See Also:
      - Constant Field Values

  - ### FORWARD_SLASH

    protected static final String FORWARD_SLASH
    See Also:
      - Constant Field Values

  - ### START_COMMENT

    protected static final String START_COMMENT
    See Also:
      - Constant Field Values

  - ### MIDDLE_COMMENT

    protected static final String MIDDLE_COMMENT
    See Also:
      - Constant Field Values

  - ### END_COMMENT

    protected static final String END_COMMENT
    See Also:
      - Constant Field Values

  - ### DIFF_COLOR

    protected static final Color DIFF_COLOR

  - ### originalHTMLData

    protected String originalHTMLData

- ## Constructor Details

  - ### HTMLDataTypeRepresentation

    protected HTMLDataTypeRepresentation()
    Default constructor for those who promise to later set the HTML text

  - ### HTMLDataTypeRepresentation

    protected HTMLDataTypeRepresentation(String htmlText)

- ## Method Details

  - ### addDataTypeLength

    protected static StringBuilder addDataTypeLength(String dataTypeLengthString, StringBuilder buffer)

  - ### addDataTypeLengthAndAlignment

    protected static StringBuilder addDataTypeLengthAndAlignment(DataType dt, StringBuilder buffer)

  - ### getDataTypeLengthString

    protected static String getDataTypeLengthString(DataType dt)

  - ### getCommentForDataType

    protected static String getCommentForDataType(DataType dataType)
    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

    protected static String truncateAsNecessary(String string)

  - ### truncateAsNecessary

    protected static String truncateAsNecessary(String string, int length)

  - ### wrapStringInColor

    protected static String wrapStringInColor(String string, Color color)

  - ### createCommentLines

    protected static List<TextLine> createCommentLines(String comment, int maxLines)
    Formats a multi-line plain-text comment as a list of HTML marked-up lines.
    Parameters:
      `comment` - multi-line plain-text string
      `maxLines` - max number of formatted lines to return
    Returns:
      list of html marked-up `TextLine`s

  - ### getHTMLString

    public String 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, call `getFullHTMLString()`.
    Returns:
      the html
    See Also:
      - `getFullHTMLString()`

  - ### getFullHTMLString

    public String getFullHTMLString()
    Returns an HTML string for this data representation object
    Returns:
      the html
    See Also:
      - `getHTMLString()`

  - ### getHTMLContentString

    public String getHTMLContentString()
    This is like `getHTMLString()`, but does not put HTML tags around the data
    Returns:
      the content

  - ### getFullHTMLContentString

    public String getFullHTMLContentString()
    This is like `getHTMLString()`, but does not put HTML tags around the data
    Returns:
      the content

  - ### diff

    public abstract HTMLDataTypeRepresentation[] diff(HTMLDataTypeRepresentation otherRepresentation)
    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

    protected List<ValidatableLine> buildHeaderText(DataType dataType)

  - ### buildFooterText

    protected TextLine buildFooterText(DataType dataType)

  - ### generateTypeName

    protected static String generateTypeName(DataType dt, Color color, boolean trim)

  - ### getDiffInput

    protected HTMLDataTypeRepresentationDiffInput getDiffInput(ValidatableLine line)

  - ### getDiffInput

    protected HTMLDataTypeRepresentationDiffInput getDiffInput(List<ValidatableLine> lines)

  - ### completelyDifferentDiff

    protected HTMLDataTypeRepresentation[] completelyDifferentDiff(HTMLDataTypeRepresentation other)

  - ### copyLines

    protected List<ValidatableLine> copyLines(List<ValidatableLine> lines)

  - ### diffTextLine

    protected void diffTextLine(TextLine textLine, TextLine otherTextLine)

  - ### createPlaceHolderLine

    protected PlaceHolderLine createPlaceHolderLine(ValidatableLine oppositeLine)
    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