public abstract static class StyledEditorKit.StyledTextAction extends TextAction
The component that gets acted upon by the action will be the source of the ActionEvent if the source can be narrowed to a JEditorPane type. If the source can't be narrowed, the most recently focused text component is changed. If neither of these are the case, the action cannot be performed.
Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans™ has been added to the java.beans package. Please see XMLEncoder.
changeSupport, enabledACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON| Constructor and Description |
|---|
StyledTextAction(String
Creates a new StyledTextAction from a string action name.
|
| Modifier and Type | Method and Description |
|---|---|
protected JEditorPane |
getEditor(ActionEvent
Gets the target editor for an action.
|
protected StyledDocument |
getStyledDocument(JEditorPane
Gets the document associated with an editor pane.
|
protected StyledEditorKit |
getStyledEditorKit(JEditorPane
Gets the editor kit associated with an editor pane.
|
protected void |
setCharacterAttributes(JEditorPane
Applies the given attributes to character content.
|
protected void |
setParagraphAttributes(JEditorPane
Applies the given attributes to paragraphs.
|
augmentList, getFocusedComponent, getTextComponentaddPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabledequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitactionPerformedpublic StyledTextAction(Stringnm)
nm - the name of the action
protected final JEditorPanegetEditor(ActionEvent e)
e - the action event
protected final StyledDocumentgetStyledDocument(JEditorPane e)
e - the editor
IllegalArgumentException - for the wrong document type
protected final StyledEditorKitgetStyledEditorKit(JEditorPane e)
e - the editor pane
IllegalArgumentException - for the wrong document type
protected final void setCharacterAttributes(JEditorPaneeditor, AttributeSet attr, boolean replace)
editor - the editor
attr - the attributes
replace - if true, then replace the existing attributes first
protected final void setParagraphAttributes(JEditorPaneeditor, AttributeSet attr, boolean replace)
editor - the editor
attr - the attributes
replace - if true, replace the existing attributes first