Module java.desktop
Package javax.swing

Class JEditorPane.JEditorPaneAccessibleHypertextSupport

All Implemented Interfaces:
Serializable, EventListener, AccessibleAction, AccessibleComponent, AccessibleEditableText, AccessibleExtendedComponent, AccessibleExtendedText, AccessibleHypertext, AccessibleText, CaretListener, DocumentListener
Enclosing class:
JEditorPane

protected class JEditorPane.JEditorPaneAccessibleHypertextSupport extends JEditorPane.AccessibleJEditorPane implements AccessibleHypertext
What's returned by AccessibleJEditorPaneHTML.getAccessibleText. Provides support for AccessibleHypertext in case there is an HTML document being displayed in this JEditorPane.
  • Constructor Details

    • JEditorPaneAccessibleHypertextSupport

      public JEditorPaneAccessibleHypertextSupport()
      Constructs a JEditorPaneAccessibleHypertextSupport.
  • Method Details

    • getLinkCount

      public int getLinkCount()
      Returns the number of links within this hypertext doc.
      Specified by:
      getLinkCount in interface AccessibleHypertext
      Returns:
      number of links in this hypertext doc.
    • getLinkIndex

      public int getLinkIndex(int charIndex)
      Returns the index into an array of hyperlinks that is associated with this character index, or -1 if there is no hyperlink associated with this index.
      Specified by:
      getLinkIndex in interface AccessibleHypertext
      Parameters:
      charIndex - index within the text
      Returns:
      index into the set of hyperlinks for this hypertext doc.
    • getLink

      public AccessibleHyperlink getLink(int linkIndex)
      Returns the index into an array of hyperlinks that index. If there is no hyperlink at this index, it returns null.
      Specified by:
      getLink in interface AccessibleHypertext
      Parameters:
      linkIndex - into the set of hyperlinks for this hypertext doc.
      Returns:
      string representation of the hyperlink
    • getLinkText

      public String getLinkText(int linkIndex)
      Returns the contiguous text within the document that is associated with this hyperlink.
      Parameters:
      linkIndex - into the set of hyperlinks for this hypertext doc.
      Returns:
      the contiguous text sharing the link at this index