public abstract static class HTMLEditorKit.HTMLTextAction extends StyledEditorKit.StyledTextAction
changeSupport, enabled
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
Constructor and Description |
---|
HTMLEditorKit.HTMLTextAction(String name)
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected int |
elementCountToTag(HTMLDocument doc,
int offset,
HTML.Tag tag)
Returns the number of elements, starting at the deepest point, needed
to get an element representing tag. -1 if no elements are found, 0 if
the parent of the leaf at offset represents the tag.
|
protected Element |
findElementMatchingTag(HTMLDocument doc,
int offset,
HTML.Tag tag)
Gets the deepest element at offset with the
matching tag.
|
protected Element[] |
getElementsAt(HTMLDocument doc,
int offset)
Returns an array of Elements that contain the offset.
|
protected HTMLDocument |
getHTMLDocument(JEditorPane e)
Gets the HTMLDocument from the JEditorPane.
|
protected HTMLEditorKit |
getHTMLEditorKit(JEditorPane e)
Gets the HTMLEditorKit
|
getEditor, getStyledDocument, getStyledEditorKit, setCharacterAttributes, setParagraphAttributes
augmentList, getFocusedComponent, getTextComponent
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
actionPerformed
public HTMLEditorKit.HTMLTextAction(String name)
protected HTMLDocument getHTMLDocument(JEditorPane e)
e
- - the editor paneprotected HTMLEditorKit getHTMLEditorKit(JEditorPane e)
e
- - the JEditorPane to get the HTMLEditorKit from.protected Element[] getElementsAt(HTMLDocument doc, int offset)
doc
- - the document to get the Elements from.offset
- - the offset the Elements must containprotected int elementCountToTag(HTMLDocument doc, int offset, HTML.Tag tag)
doc
- -
the document to searchoffset
- -
the offset to checktag
- -
the tag to look forprotected Element findElementMatchingTag(HTMLDocument doc, int offset, HTML.Tag tag)
doc
- - the document to searchoffset
- - the offset to check fortag
- - the tag to match