public abstract static class StyledEditorKit.StyledTextAction extends TextAction
使受作用的成分将ActionEvent源如果源可以缩小到一个jeditorpane型。如果源不能被缩小,最近聚焦的文本组件将被更改。如果这些都不是这样的情况下,无法执行的动作。
警告:序列化该类的对象与以后的Swing版本不兼容。当前的序列化支持适用于短期贮藏或RMI运行相同Swing版本的应用程序之间。为1.4,为所有JavaBeans™长期存储的支持已被添加到java.beans包。请看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 nm)
创建一个字符串行动命名一个新的styledtextaction。
|
| Modifier and Type | Method and Description |
|---|---|
protected JEditorPane |
getEditor(ActionEvent e)
获取一个动作的目标编辑器。
|
protected StyledDocument |
getStyledDocument(JEditorPane e)
获取与编辑器窗格关联的文档。
|
protected StyledEditorKit |
getStyledEditorKit(JEditorPane e)
获取与编辑器窗格关联的编辑工具包。
|
protected void |
setCharacterAttributes(JEditorPane editor, AttributeSet attr, boolean replace)
将给定的属性应用于字符内容。
|
protected void |
setParagraphAttributes(JEditorPane editor, AttributeSet attr, boolean replace)
将给定的属性应用到段落。
|
augmentList, getFocusedComponent, getTextComponentaddPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabledequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitactionPerformedpublic StyledTextAction(String nm)
nm -动作的名称
protected final JEditorPane getEditor(ActionEvent e)
e -动作事件
protected final StyledDocument getStyledDocument(JEditorPane e)
e -编辑
IllegalArgumentException -错误的文件类型
protected final StyledEditorKit getStyledEditorKit(JEditorPane e)
e -编辑器窗格
IllegalArgumentException -错误的文件类型
protected final void setCharacterAttributes(JEditorPane editor, AttributeSet attr, boolean replace)
editor -编辑
attr -属性
replace -如果是真的,然后替换现有的属性
protected final void setParagraphAttributes(JEditorPane editor, AttributeSet attr, boolean replace)
editor -编辑
attr -属性
replace -如果属实,取代现有的属性
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.