|
Java™ Platform Standard Ed. 6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.AbstractAction javax.swing.text.TextAction javax.swing.text.StyledEditorKit.StyledTextAction
public abstract static class StyledEditorKit.StyledTextAction
An action that assumes it's being fired on a JEditorPane with a StyledEditorKit (or subclass) installed. This has some convenience methods for causing character or paragraph level attribute changes. The convenience methods will throw an IllegalArgumentException if the assumption of a StyledDocument, a JEditorPane, or a StyledEditorKit fail to be true.
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 JavaBeansTM
has been added to the java.beans
package.
Please see XMLEncoder
.
Field Summary |
---|
Fields inherited from class javax.swing.AbstractAction |
---|
changeSupport, enabled |
Fields inherited from interface javax.swing.Action |
---|
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON |
Constructor Summary | |
---|---|
StyledEditorKit.StyledTextAction(String nm)
Creates a new StyledTextAction from a string action name. |
Method Summary | |
---|---|
protected JEditorPane |
getEditor(ActionEvent e)
Gets the target editor for an action. |
protected StyledDocument |
getStyledDocument(JEditorPane e)
Gets the document associated with an editor pane. |
protected StyledEditorKit |
getStyledEditorKit(JEditorPane e)
Gets the editor kit associated with an editor pane. |
protected void |
setCharacterAttributes(JEditorPane editor,
AttributeSet attr,
boolean replace)
Applies the given attributes to character content. |
protected void |
setParagraphAttributes(JEditorPane editor,
AttributeSet attr,
boolean replace)
Applies the given attributes to paragraphs. |
Methods inherited from class javax.swing.text.TextAction |
---|
augmentList, getFocusedComponent, getTextComponent |
Methods inherited from class javax.swing.AbstractAction |
---|
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.awt.event.ActionListener |
---|
actionPerformed |
Constructor Detail |
---|
public StyledEditorKit.StyledTextAction(String nm)
nm
- the name of the actionMethod Detail |
---|
protected final JEditorPane getEditor(ActionEvent e)
e
- the action event
protected final StyledDocument getStyledDocument(JEditorPane e)
e
- the editor
IllegalArgumentException
- for the wrong document typeprotected final StyledEditorKit getStyledEditorKit(JEditorPane e)
e
- the editor pane
IllegalArgumentException
- for the wrong document typeprotected final void setCharacterAttributes(JEditorPane editor, AttributeSet attr, boolean replace)
editor
- the editorattr
- the attributesreplace
- if true, then replace the existing attributes firstprotected final void setParagraphAttributes(JEditorPane editor, AttributeSet attr, boolean replace)
editor
- the editorattr
- the attributesreplace
- if true, replace the existing attributes first
|
Java™ Platform Standard Ed. 6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1993, 2015, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.