Spec-Zone .ru
спецификации, руководства, описания, API
|
|
Java™ Platform Standard Ed. 7 DRAFT ea-b118 |
|||||||||
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 extends TextAction
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
.
Modifier and Type | Field and Description |
---|
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 and Description |
---|
StyledEditorKit.StyledTextAction(String nm)
Creates a new StyledTextAction from a string action name. |
Modifier and Type | Method and Description |
---|---|
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 eventprotected final StyledDocument getStyledDocument(JEditorPane e)
e
- the editorIllegalArgumentException
- for the wrong document typeprotected final StyledEditorKit getStyledEditorKit(JEditorPane e)
e
- the editor paneIllegalArgumentException
- 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. 7 DRAFT ea-b118 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1993, 2010, Oracle Corporation. All rights reserved.