|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.AbstractAction
javax.swing.text.TextAction
javax.swing.text.StyledEditorKit.StyledTextAction
public abstract static class StyledEditorKit.StyledTextAction
The abstract superclass of all styled TextActions. This class provides some useful methods to manipulate the text attributes.
Field Summary |
---|
Fields inherited from class javax.swing.AbstractAction |
---|
changeSupport, enabled |
Fields inherited from interface javax.swing.Action |
---|
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON |
Constructor Summary | |
---|---|
StyledEditorKit.StyledTextAction(String nm)
Creates a new instance of StyledTextAction . |
Method Summary | |
---|---|
protected JEditorPane |
getEditor(ActionEvent event)
Returns the JEditorPane component from which the
ActionEvent originated. |
protected StyledDocument |
getStyledDocument(JEditorPane editor)
Returns the StyledDocument that is used by editor . |
protected StyledEditorKit |
getStyledEditorKit(JEditorPane editor)
Returns the StyledEditorKit that is used by editor . |
protected void |
setCharacterAttributes(JEditorPane editor,
AttributeSet atts,
boolean replace)
Sets the specified character attributes on the currently selected text of editor . |
protected void |
setParagraphAttributes(JEditorPane editor,
AttributeSet atts,
boolean replace)
Sets the specified character attributes on the paragraph that contains the currently selected text of editor . |
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)
StyledTextAction
.
nm
- the name of the StyledTextAction
Method Detail |
---|
protected final JEditorPane getEditor(ActionEvent event)
JEditorPane
component from which the
ActionEvent
originated.
event
- the ActionEvent
JEditorPane
component from which the
ActionEvent
originatedprotected final void setCharacterAttributes(JEditorPane editor, AttributeSet atts, boolean replace)
editor
. If editor
does not have
a selection, then the attributes are used as input attributes
for newly inserted content.
editor
- the JEditorPane
componentatts
- the text attributes to setreplace
- if true
the current attributes of the
selection are replaces, otherwise they are mergedprotected final StyledDocument getStyledDocument(JEditorPane editor)
StyledDocument
that is used by editor
.
editor
- the JEditorPane
from which to get the
StyledDocument
StyledDocument
that is used by editor
protected final StyledEditorKit getStyledEditorKit(JEditorPane editor)
StyledEditorKit
that is used by editor
.
editor
- the JEditorPane
from which to get the
StyledEditorKit
StyledEditorKit
that is used by editor
protected final void setParagraphAttributes(JEditorPane editor, AttributeSet atts, boolean replace)
editor
. If editor
does not have
a selection, then the attributes are set on the paragraph that
contains the current caret position.
editor
- the JEditorPane
componentatts
- the text attributes to setreplace
- if true
the current attributes of the
selection are replaces, otherwise they are merged
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |