Class HTMLDataTypeRepresentation

    • Constructor Detail

      • HTMLDataTypeRepresentation

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

        protected HTMLDataTypeRepresentation​(java.lang.String htmlText)
    • Method Detail

      • addDataTypeLength

        protected static java.lang.StringBuilder addDataTypeLength​(java.lang.String dataTypeLengthString,
                                                                   java.lang.StringBuilder buffer)
      • addDataTypeLength

        protected static java.lang.StringBuilder addDataTypeLength​(DataType dt,
                                                                   java.lang.StringBuilder buffer)
      • getDataTypeLengthString

        protected static java.lang.String getDataTypeLengthString​(DataType dt)
      • getCommentForDataType

        protected static java.lang.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 java.lang.String truncateAsNecessary​(java.lang.String string)
      • truncateAsNecessary

        protected static java.lang.String truncateAsNecessary​(java.lang.String string,
                                                              int length)
      • wrapStringInColor

        protected static java.lang.String wrapStringInColor​(java.lang.String string,
                                                            java.awt.Color color)
      • createCommentLines

        protected static java.util.List<TextLine> createCommentLines​(java.lang.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 TextLines
      • getLocatableDataType

        protected static DataType getLocatableDataType​(DataType type)
      • getHTMLString

        public java.lang.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 java.lang.String getFullHTMLString()
        Returns an HTML string for this data representation object
        Returns:
        the html
        See Also:
        getHTMLString()
      • getHTMLContentString

        public java.lang.String getHTMLContentString()
        This is like getHTMLString(), but does not put HTML tags around the data
        Returns:
        the content
      • getFullHTMLContentString

        public java.lang.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.
      • 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