HTMLEditorKit.HTMLFactory (Java SE 26 & JDK 26)
Description: declaration: module: java.desktop, package: javax.swing.text.html, class: HTMLEditorKit, class: HTMLFactory
Keywords: javax.swing.text.html.HTMLEditorKit.HTMLFactory class

# Class HTMLEditorKit.HTMLFactory

java.lang.Object
javax.swing.text.html.HTMLEditorKit.HTMLFactory

All Implemented Interfaces:
  `ViewFactory`

Enclosing class:
  `HTMLEditorKit`

public static class HTMLEditorKit.HTMLFactory extends Object implements ViewFactory
A factory to build views for HTML. The following table describes what this factory will build by default.

Describes the tag and view created by this factory by default
Tag | View created
--- | ---
HTML.Tag.CONTENT | InlineView
HTML.Tag.IMPLIED | javax.swing.text.html.ParagraphView
HTML.Tag.P | javax.swing.text.html.ParagraphView
HTML.Tag.H1 | javax.swing.text.html.ParagraphView
HTML.Tag.H2 | javax.swing.text.html.ParagraphView
HTML.Tag.H3 | javax.swing.text.html.ParagraphView
HTML.Tag.H4 | javax.swing.text.html.ParagraphView
HTML.Tag.H5 | javax.swing.text.html.ParagraphView
HTML.Tag.H6 | javax.swing.text.html.ParagraphView
HTML.Tag.DT | javax.swing.text.html.ParagraphView
HTML.Tag.MENU | ListView
HTML.Tag.DIR | ListView
HTML.Tag.UL | ListView
HTML.Tag.OL | ListView
HTML.Tag.LI | BlockView
HTML.Tag.DL | BlockView
HTML.Tag.DD | BlockView
HTML.Tag.BODY | BlockView
HTML.Tag.HTML | BlockView
HTML.Tag.CENTER | BlockView
HTML.Tag.DIV | BlockView
HTML.Tag.BLOCKQUOTE | BlockView
HTML.Tag.PRE | BlockView
HTML.Tag.BLOCKQUOTE | BlockView
HTML.Tag.PRE | BlockView
HTML.Tag.IMG | ImageView
HTML.Tag.HR | HRuleView
HTML.Tag.BR | BRView
HTML.Tag.TABLE | javax.swing.text.html.TableView
HTML.Tag.INPUT | FormView
HTML.Tag.SELECT | FormView
HTML.Tag.TEXTAREA | FormView
HTML.Tag.OBJECT | ObjectView
HTML.Tag.FRAMESET | FrameSetView
HTML.Tag.FRAME | FrameView

Implementation Note:
  Parsed tags that are unrecognized or are recognized but unsupported are handled differently by the editor.
  - When the container is editable:
    - The tags will be displayed as editable text fields with the tag name.
    - The content within the tags will be handled by the editor as regular text.
  - When the container is not editable:
    - If the tag is recognized but not supported, such as script tags, the tag and its contents will be hidden.
    - If the tag is unknown, the tag will be hidden but its contents will display as regular text.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `HTMLFactory()`
  Constructs a `HTMLFactory`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `View`
  `create(Element elem)`
  Creates a view from an element.

  ### Methods declared in class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
  Modifier and Type
  Method
  Description
  `protected Object`
  `clone()`
  Creates and returns a copy of this object.
  `boolean`
  `equals(Object obj)`
  Indicates whether some other object is "equal to" this one.
  `protected void`
  `finalize()`
  Deprecated, for removal: This API element is subject to removal in a future version.
  Finalization is deprecated and subject to removal in a future release.
  `final Class<?>`
  `getClass()`
  Returns the runtime class of this `Object`.
  `int`
  `hashCode()`
  Returns a hash code value for this object.
  `final void`
  `notify()`
  Wakes up a single thread that is waiting on this object's monitor.
  `final void`
  `notifyAll()`
  Wakes up all threads that are waiting on this object's monitor.
  `String`
  `toString()`
  Returns a string representation of the object.
  `final void`
  `wait()`
  Causes the current thread to wait until it is awakened, typically by being notified or interrupted.
  `final void`
  `wait(long timeoutMillis)`
  Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
  `final void`
  `wait(long timeoutMillis, int nanos)`
  Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

- ## Constructor Details

  - ### HTMLFactory

    public HTMLFactory()
    Constructs a `HTMLFactory`.

- ## Method Details

  - ### create

    public View create(Element elem)
    Creates a view from an element.
    Specified by:
      `create` in interface `ViewFactory`
    Parameters:
      `elem` - the element
    Returns:
      the view
    See Also:
      - `View`