Class Bdo<T extends Bdo<T>>


public class Bdo<T extends Bdo<T>> extends PhrasingContentElement<T>
Represents an HTML <bdo> element for bi-directional text override.

The Bdo (Bi-Directional Override) element overrides the current text direction, forcing the text to be rendered in a specified direction (left-to-right or right-to-left), regardless of the Unicode bi-directional algorithm.

Features:

  • Forces text direction override (LTR or RTL)
  • Overrides Unicode bi-directional algorithm
  • Useful for displaying text in opposite direction
  • Required dir attribute for proper rendering

Usage:


 Bdo rtl = new Bdo("This text will be right-to-left", TextDirection.RTL);
 Bdo ltr = new Bdo("This text will be left-to-right", TextDirection.LTR);
 
Since:
2007
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Constructor Details

    • Bdo

      public Bdo()
      Constructs an empty <bdo> element.
    • Bdo

      public Bdo(String text)
      Constructs a <bdo> element with text content.
      Parameters:
      text - the text content
    • Bdo

      public Bdo(String text, TextDirection dir)
      Constructs a <bdo> element with text content and direction.
      Parameters:
      text - the text content
      dir - the text direction (LTR or RTL)
  • Method Details

    • setDir

      public final T setDir(TextDirection dir)
      Sets the text direction for this element.
      Overrides:
      setDir in class Element<T extends Bdo<T>>
      Parameters:
      dir - the text direction (LTR or RTL)
      Returns:
      This element for method chaining.
    • setDir

      public final T setDir(String dir)
      Sets the text direction for this element.
      Overrides:
      setDir in class Element<T extends Bdo<T>>
      Parameters:
      dir - the text direction as a string (e.g., "ltr", "rtl")
      Returns:
      This element for method chaining.