Class InlineBox

java.lang.Object
org.xhtmlrenderer.render.InlineBox
All Implemented Interfaces:
Styleable

public class InlineBox extends Object implements Styleable
A class which represents a portion of an inline element. If an inline element does not contain any nested elements, then a single InlineBox object will contain the content for the entire element. Otherwise, multiple InlineBox objects will be created corresponding to each discrete chunk of text appearing in the element. It is not rendered directly (and hence does not extend from Box), but does play an important role in layout (for example, when calculating min/max widths). Note that it does not contain children. Inline content is stored as a flat list in the layout tree. However, InlineBox does contain enough information to reconstruct the original element nesting and this is, in fact, done during inline layout.
See Also:
  • Field Details

    • _element

      private @Nullable Element _element
    • _originalText

      private String _originalText
    • _text

      private String _text
    • _removableWhitespace

      private boolean _removableWhitespace
    • _startsHere

      private boolean _startsHere
    • _endsHere

      private boolean _endsHere
    • _style

      private @Nullable CalculatedStyle _style
    • _contentFunction

      private final @Nullable ContentFunction _contentFunction
    • _function

      private final @Nullable FSFunction _function
    • _minMaxCalculated

      private boolean _minMaxCalculated
    • _maxWidth

      private int _maxWidth
    • _minWidth

      private int _minWidth
    • _firstLineWidth

      private int _firstLineWidth
    • _pseudoElementOrClass

      private final @Nullable String _pseudoElementOrClass
    • _textNode

      private final @Nullable Text _textNode
  • Constructor Details

  • Method Details

    • getText

      public String getText()
    • setText

      public void setText(String text)
    • applyTextTransform

      public void applyTextTransform()
    • isRemovableWhitespace

      public boolean isRemovableWhitespace()
    • setRemovableWhitespace

      public void setRemovableWhitespace(boolean removableWhitespace)
    • isEndsHere

      public boolean isEndsHere()
    • setEndsHere

      public void setEndsHere(boolean endsHere)
    • isStartsHere

      public boolean isStartsHere()
    • setStartsHere

      public void setStartsHere(boolean startsHere)
    • getStyle

      @CheckReturnValue public @Nullable CalculatedStyle getStyle()
      Specified by:
      getStyle in interface Styleable
    • setStyle

      public void setStyle(@Nullable CalculatedStyle style)
      Specified by:
      setStyle in interface Styleable
    • getElement

      @CheckReturnValue public @Nullable Element getElement()
      Specified by:
      getElement in interface Styleable
    • setElement

      public void setElement(@Nullable Element element)
      Specified by:
      setElement in interface Styleable
    • getContentFunction

      @CheckReturnValue public @Nullable ContentFunction getContentFunction()
    • isDynamicFunction

      public boolean isDynamicFunction()
    • getTextWidth

      @CheckReturnValue private int getTextWidth(LayoutContext c, String s)
    • getMaxCharWidth

      @CheckReturnValue private int getMaxCharWidth(LayoutContext c, String s)
    • calcMaxWidthFromLineLength

      private void calcMaxWidthFromLineLength(LayoutContext c, int cbWidth, boolean trim)
    • getSpaceWidth

      @CheckReturnValue public int getSpaceWidth(LayoutContext c)
    • getTrailingSpaceWidth

      @CheckReturnValue public int getTrailingSpaceWidth(LayoutContext c)
    • calcMinWidthFromWordLength

      private int calcMinWidthFromWordLength(LayoutContext c, int cbWidth, boolean trimLeadingSpace, boolean includeWS)
    • getText

      @CheckReturnValue private String getText(boolean trimLeadingSpace)
    • getInlineMBP

      @CheckReturnValue private int getInlineMBP(LayoutContext c, int cbWidth)
    • calcMinMaxWidth

      public void calcMinMaxWidth(LayoutContext c, int cbWidth, boolean trimLeadingSpace)
    • getMaxWidth

      public int getMaxWidth()
    • getMinWidth

      public int getMinWidth()
    • getFirstLineWidth

      public int getFirstLineWidth()
    • getPseudoElementOrClass

      @CheckReturnValue public @Nullable String getPseudoElementOrClass()
      Specified by:
      getPseudoElementOrClass in interface Styleable
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • appendPositioningInfo

      protected void appendPositioningInfo(StringBuilder result)
    • shortText

      private String shortText()
    • getFunction

      public @Nullable FSFunction getFunction()
    • truncateText

      public void truncateText()
    • getTextNode

      @CheckReturnValue public @Nullable Text getTextNode()