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)
        Convenience constructor for those representations that don't really do much, like diffing.
    • Method Detail

      • addDataTypeLength

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

        protected static java.lang.StringBuffer addDataTypeLength​(DataType dt,
                                                                  java.lang.StringBuffer buffer)
      • 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)
        Returns a data type that can later be located
      • getHTMLString

        public java.lang.String getHTMLString()
      • getHTMLContentString

        public java.lang.String getHTMLContentString()
        This is like getHTMLString(), but does not put HTML tags around the data.
      • 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.