| 
 | JavaTM 2 Platform Standard Ed. 5.0 | |||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectjavax.swing.AbstractAction
javax.swing.text.TextAction
javax.swing.text.StyledEditorKit.StyledTextAction
public abstract static class StyledEditorKit.StyledTextAction
假定是在安装有 StyledEditorKit(或者子类)的 JEditorPane 上触发的操作。此操作具有一些便捷的方法,能导致字符或段落级的属性更改。如果假定 StyledDocument、JEditorPane 或 StyledEditorKit 失败为 true,则此便捷方法将抛出一个 IllegalArgumentException。
如果 ActionEvent 的源可缩小为一个 JEditorPane 类型,则事件在其上执行的组件将成为 ActionEvent 的源。如果该源不能缩小,则更改最近获得焦点的文本组件。如果不是以上两种情况,则不能执行该操作。
警告:此类的已序列化对象与以后的 Swing 版本不兼容。当前序列化支持适用于短期存储或运行相同 Swing 版本的应用程序之间的 RMI。从 1.4 版本开始,已在 java.beans 包中添加了支持所有 JavaBeansTM 长期存储的功能。请参见 XMLEncoder。
| 字段摘要 | 
|---|
| 从类 javax.swing.AbstractAction 继承的字段 | 
|---|
| changeSupport, enabled | 
| 从接口 javax.swing.Action 继承的字段 | 
|---|
| ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON | 
| 构造方法摘要 | |
|---|---|
| StyledEditorKit.StyledTextAction(String nm)通过字符串操作名称创建新的 StyledTextAction。 | |
| 方法摘要 | |
|---|---|
| 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)对段落应用给定的属性。 | 
| 从类 javax.swing.text.TextAction 继承的方法 | 
|---|
| augmentList, getFocusedComponent, getTextComponent | 
| 从类 javax.swing.AbstractAction 继承的方法 | 
|---|
| addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled | 
| 从类 java.lang.Object 继承的方法 | 
|---|
| equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| 从接口 java.awt.event.ActionListener 继承的方法 | 
|---|
| actionPerformed | 
| 构造方法详细信息 | 
|---|
public StyledEditorKit.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 - 如果为 true,则首先替换现有的属性protected final void setParagraphAttributes(JEditorPane editor, AttributeSet attr, boolean replace)
editor - 编辑器attr - 属性replace - 如果为 true,则首先替换现有的属性| 
 | JavaTM 2 Platform Standard Ed. 5.0 | |||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
版权所有 2004 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。