HTMLEditorKit.HTMLTextAction (Java Platform SE 8 ) (original) (raw)
- javax.swing.AbstractAction
- javax.swing.text.TextAction
- javax.swing.text.StyledEditorKit.StyledTextAction
* * javax.swing.text.html.HTMLEditorKit.HTMLTextAction
- javax.swing.text.StyledEditorKit.StyledTextAction
- javax.swing.text.TextAction
All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action
Direct Known Subclasses:
HTMLEditorKit.InsertHTMLTextAction
Enclosing class:
HTMLEditorKit
public abstract static class HTMLEditorKit.HTMLTextAction
extends StyledEditorKit.StyledTextAction
An abstract Action providing some convenience methods that may be useful in inserting HTML into an existing document.
NOTE: None of the convenience methods obtain a lock on the document. If you have another thread modifying the text these methods may have inconsistent behavior, or return the wrong thing.
Field Summary
* ### Fields inherited from class javax.swing.[AbstractAction](../../../../javax/swing/AbstractAction.html "class in javax.swing") `[changeSupport](../../../../javax/swing/AbstractAction.html#changeSupport), [enabled](../../../../javax/swing/AbstractAction.html#enabled)` * ### Fields inherited from interface javax.swing.[Action](../../../../javax/swing/Action.html "interface in javax.swing") `[ACCELERATOR_KEY](../../../../javax/swing/Action.html#ACCELERATOR%5FKEY), [ACTION_COMMAND_KEY](../../../../javax/swing/Action.html#ACTION%5FCOMMAND%5FKEY), [DEFAULT](../../../../javax/swing/Action.html#DEFAULT), [DISPLAYED_MNEMONIC_INDEX_KEY](../../../../javax/swing/Action.html#DISPLAYED%5FMNEMONIC%5FINDEX%5FKEY), [LARGE_ICON_KEY](../../../../javax/swing/Action.html#LARGE%5FICON%5FKEY), [LONG_DESCRIPTION](../../../../javax/swing/Action.html#LONG%5FDESCRIPTION), [MNEMONIC_KEY](../../../../javax/swing/Action.html#MNEMONIC%5FKEY), [NAME](../../../../javax/swing/Action.html#NAME), [SELECTED_KEY](../../../../javax/swing/Action.html#SELECTED%5FKEY), [SHORT_DESCRIPTION](../../../../javax/swing/Action.html#SHORT%5FDESCRIPTION), [SMALL_ICON](../../../../javax/swing/Action.html#SMALL%5FICON)`
Constructor Summary
Constructors
Constructor Description HTMLTextAction(String name) Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type Method Description protected int elementCountToTag(HTMLDocument doc, int offset,HTML.Tag tag) Returns number of elements, starting at the deepest leaf, needed to get to an element representing tag. protected Element findElementMatchingTag(HTMLDocument doc, int offset,HTML.Tag tag) Returns the deepest element at offset matchingtag. protected Element[] getElementsAt(HTMLDocument doc, int offset) Returns an array of the Elements that contain offset. protected HTMLDocument getHTMLDocument(JEditorPane e) protected HTMLEditorKit getHTMLEditorKit(JEditorPane e) * ### Methods inherited from class javax.swing.text.[StyledEditorKit.StyledTextAction](../../../../javax/swing/text/StyledEditorKit.StyledTextAction.html "class in javax.swing.text") `[getEditor](../../../../javax/swing/text/StyledEditorKit.StyledTextAction.html#getEditor-java.awt.event.ActionEvent-), [getStyledDocument](../../../../javax/swing/text/StyledEditorKit.StyledTextAction.html#getStyledDocument-javax.swing.JEditorPane-), [getStyledEditorKit](../../../../javax/swing/text/StyledEditorKit.StyledTextAction.html#getStyledEditorKit-javax.swing.JEditorPane-), [setCharacterAttributes](../../../../javax/swing/text/StyledEditorKit.StyledTextAction.html#setCharacterAttributes-javax.swing.JEditorPane-javax.swing.text.AttributeSet-boolean-), [setParagraphAttributes](../../../../javax/swing/text/StyledEditorKit.StyledTextAction.html#setParagraphAttributes-javax.swing.JEditorPane-javax.swing.text.AttributeSet-boolean-)` * ### Methods inherited from class javax.swing.text.[TextAction](../../../../javax/swing/text/TextAction.html "class in javax.swing.text") `[augmentList](../../../../javax/swing/text/TextAction.html#augmentList-javax.swing.Action:A-javax.swing.Action:A-), [getFocusedComponent](../../../../javax/swing/text/TextAction.html#getFocusedComponent--), [getTextComponent](../../../../javax/swing/text/TextAction.html#getTextComponent-java.awt.event.ActionEvent-)` * ### Methods inherited from class javax.swing.[AbstractAction](../../../../javax/swing/AbstractAction.html "class in javax.swing") `[addPropertyChangeListener](../../../../javax/swing/AbstractAction.html#addPropertyChangeListener-java.beans.PropertyChangeListener-), [clone](../../../../javax/swing/AbstractAction.html#clone--), [firePropertyChange](../../../../javax/swing/AbstractAction.html#firePropertyChange-java.lang.String-java.lang.Object-java.lang.Object-), [getKeys](../../../../javax/swing/AbstractAction.html#getKeys--), [getPropertyChangeListeners](../../../../javax/swing/AbstractAction.html#getPropertyChangeListeners--), [getValue](../../../../javax/swing/AbstractAction.html#getValue-java.lang.String-), [isEnabled](../../../../javax/swing/AbstractAction.html#isEnabled--), [putValue](../../../../javax/swing/AbstractAction.html#putValue-java.lang.String-java.lang.Object-), [removePropertyChangeListener](../../../../javax/swing/AbstractAction.html#removePropertyChangeListener-java.beans.PropertyChangeListener-), [setEnabled](../../../../javax/swing/AbstractAction.html#setEnabled-boolean-)` * ### Methods inherited from class java.lang.[Object](../../../../java/lang/Object.html "class in java.lang") `[equals](../../../../java/lang/Object.html#equals-java.lang.Object-), [finalize](../../../../java/lang/Object.html#finalize--), [getClass](../../../../java/lang/Object.html#getClass--), [hashCode](../../../../java/lang/Object.html#hashCode--), [notify](../../../../java/lang/Object.html#notify--), [notifyAll](../../../../java/lang/Object.html#notifyAll--), [toString](../../../../java/lang/Object.html#toString--), [wait](../../../../java/lang/Object.html#wait--), [wait](../../../../java/lang/Object.html#wait-long-), [wait](../../../../java/lang/Object.html#wait-long-int-)` * ### Methods inherited from interface java.awt.event.[ActionListener](../../../../java/awt/event/ActionListener.html "interface in java.awt.event") `[actionPerformed](../../../../java/awt/event/ActionListener.html#actionPerformed-java.awt.event.ActionEvent-)`
Constructor Detail
* #### HTMLTextAction public HTMLTextAction([String](../../../../java/lang/String.html "class in java.lang") name)
Method Detail
* #### getHTMLDocument protected [HTMLDocument](../../../../javax/swing/text/html/HTMLDocument.html "class in javax.swing.text.html") getHTMLDocument([JEditorPane](../../../../javax/swing/JEditorPane.html "class in javax.swing") e) Returns: HTMLDocument of `e`. * #### getHTMLEditorKit protected [HTMLEditorKit](../../../../javax/swing/text/html/HTMLEditorKit.html "class in javax.swing.text.html") getHTMLEditorKit([JEditorPane](../../../../javax/swing/JEditorPane.html "class in javax.swing") e) Returns: HTMLEditorKit for `e`. * #### getElementsAt protected [Element](../../../../javax/swing/text/Element.html "interface in javax.swing.text")[] getElementsAt([HTMLDocument](../../../../javax/swing/text/html/HTMLDocument.html "class in javax.swing.text.html") doc, int offset) Returns an array of the Elements that contain `offset`. The first elements corresponds to the root. * #### elementCountToTag protected int elementCountToTag([HTMLDocument](../../../../javax/swing/text/html/HTMLDocument.html "class in javax.swing.text.html") doc, int offset, [HTML.Tag](../../../../javax/swing/text/html/HTML.Tag.html "class in javax.swing.text.html") tag) Returns number of elements, starting at the deepest leaf, needed to get to an element representing `tag`. This will return -1 if no elements is found representing `tag`, or 0 if the parent of the leaf at `offset` represents`tag`. * #### findElementMatchingTag protected [Element](../../../../javax/swing/text/Element.html "interface in javax.swing.text") findElementMatchingTag([HTMLDocument](../../../../javax/swing/text/html/HTMLDocument.html "class in javax.swing.text.html") doc, int offset, [HTML.Tag](../../../../javax/swing/text/html/HTML.Tag.html "class in javax.swing.text.html") tag) Returns the deepest element at `offset` matching`tag`.
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.