uTools-Manuals/docs/java/javax/swing/text/StyledEditorKit.StyledTextAction.html

324 lines
20 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div class="header">
<div class="subTitle">
javax.swing.text
</div>
<h2 class="title" title="Class StyledEditorKit.StyledTextAction">Class StyledEditorKit.StyledTextAction</h2>
</div><div class="contentContainer">
<ul class="inheritance">
<li><a href="../../../java/lang/Object.html" title="class in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li><a href="../../../javax/swing/AbstractAction.html" title="class in javax.swing">javax.swing.AbstractAction</a></li>
<li>
<ul class="inheritance">
<li><a href="../../../javax/swing/text/TextAction.html" title="class in javax.swing.text">javax.swing.text.TextAction</a></li>
<li>
<ul class="inheritance">
<li>javax.swing.text.StyledEditorKit.StyledTextAction</li>
</ul> </li>
</ul> </li>
</ul> </li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>
All Implemented Interfaces:
</dt>
<dd>
<span><a href="../../../java/awt/event/ActionListener.html" title="java.awt.event中的接口">ActionListener</a> <a href="../../../java/io/Serializable.html" title="java.io中的接口">Serializable</a> <a href="../../../java/lang/Cloneable.html" title="java.lang中的接口">Cloneable</a> <a href="../../../java/util/EventListener.html" title="java.util中的接口">EventListener</a> <a href="../../../javax/swing/Action.html" title="javax.swing中的接口">Action</a></span>
</dd>
</dl>
<dl>
<dt>
已知直接子类:
</dt>
<dd>
<span><a href="../../../javax/swing/text/html/HTMLEditorKit.HTMLTextAction.html" title="javax.swing.text.html中的类">HTMLEditorKit.HTMLTextAction</a> <a href="../../../javax/swing/text/StyledEditorKit.AlignmentAction.html" title="javax.swing.text中的类">StyledEditorKit.AlignmentAction</a> <a href="../../../javax/swing/text/StyledEditorKit.BoldAction.html" title="javax.swing.text中的类">StyledEditorKit.BoldAction</a> <a href="../../../javax/swing/text/StyledEditorKit.FontFamilyAction.html" title="javax.swing.text中的类">StyledEditorKit.FontFamilyAction</a> <a href="../../../javax/swing/text/StyledEditorKit.FontSizeAction.html" title="javax.swing.text中的类">StyledEditorKit.FontSizeAction</a> <a href="../../../javax/swing/text/StyledEditorKit.ForegroundAction.html" title="javax.swing.text中的类">StyledEditorKit.ForegroundAction</a> <a href="../../../javax/swing/text/StyledEditorKit.ItalicAction.html" title="javax.swing.text中的类">StyledEditorKit.ItalicAction</a> <a href="../../../javax/swing/text/StyledEditorKit.UnderlineAction.html" title="javax.swing.text中的类">StyledEditorKit.UnderlineAction</a></span>
</dd>
</dl>
<dl>
<dt>
Enclosing class:
</dt>
<dd>
<span><a href="../../../javax/swing/text/StyledEditorKit.html" title="javax.swing.text中的类">StyledEditorKit</a></span>
</dd>
</dl>
<hr/> <br/> <pre>public abstract static class <span class="typeNameLabel">StyledEditorKit.StyledTextAction</span>
extends <a href="../../../javax/swing/text/TextAction.html" title="class in javax.swing.text">TextAction</a></pre>
<div class="block">
<span>一个假定它被安装在一个带有StyledEditorKit或子类的JEditorPane上被触发的动作。</span>
<span>这有一些方便的方法来引起角色或段落级别的属性更改。</span>
<span>如果StyledDocumentJEditorPane或StyledEditorKit的假设不成立那么方便方法将抛出IllegalArgumentException异常。</span>
<p> <span>如果源可以缩小为JEditorPane类型则动作所采取行动的组件将成为ActionEvent的源。</span> <span>如果源无法缩小,则最近重点关注的文本组件将被更改。</span> <span>如果这些都不是这种情况,则无法执行该操作。</span> </p>
<p> <span><strong>警告:</strong>此类的序列化对象与将来的Swing版本不兼容。</span> <span>当前的序列化支持适用于运行相同版本的Swing的应用程序之间的短期存储或RMI。</span> <span>从1.4开始对所有JavaBeans的长期存储的支持已被添加到<code>java.beans</code>包中。</span> <span>请参阅<a href="../../../java/beans/XMLEncoder.html" title="java.beans中的类"><code>XMLEncoder</code></a></span> </p>
</div> </li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- --> </a> <h3>Field Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="fields.inherited.from.class.javax.swing.AbstractAction">
<!-- --> </a> <h3>Fields inherited from class javax.swing.<a href="../../../javax/swing/AbstractAction.html" title="class in javax.swing">AbstractAction</a></h3> <code><a href="../../../javax/swing/AbstractAction.html#changeSupport">changeSupport</a>, <a href="../../../javax/swing/AbstractAction.html#enabled">enabled</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="fields.inherited.from.class.javax.swing.Action">
<!-- --> </a> <h3>Fields inherited from interface javax.swing.<a href="../../../javax/swing/Action.html" title="interface in javax.swing">Action</a></h3> <code><a href="../../../javax/swing/Action.html#ACCELERATOR_KEY">ACCELERATOR_KEY</a>, <a href="../../../javax/swing/Action.html#ACTION_COMMAND_KEY">ACTION_COMMAND_KEY</a>, <a href="../../../javax/swing/Action.html#DEFAULT">DEFAULT</a>, <a href="../../../javax/swing/Action.html#DISPLAYED_MNEMONIC_INDEX_KEY">DISPLAYED_MNEMONIC_INDEX_KEY</a>, <a href="../../../javax/swing/Action.html#LARGE_ICON_KEY">LARGE_ICON_KEY</a>, <a href="../../../javax/swing/Action.html#LONG_DESCRIPTION">LONG_DESCRIPTION</a>, <a href="../../../javax/swing/Action.html#MNEMONIC_KEY">MNEMONIC_KEY</a>, <a href="../../../javax/swing/Action.html#NAME">NAME</a>, <a href="../../../javax/swing/Action.html#SELECTED_KEY">SELECTED_KEY</a>, <a href="../../../javax/swing/Action.html#SHORT_DESCRIPTION">SHORT_DESCRIPTION</a>, <a href="../../../javax/swing/Action.html#SMALL_ICON">SMALL_ICON</a></code></li>
</ul> </li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- --> </a> <h3>构造方法摘要</h3>
<table border="0" cellpadding="3" cellspacing="0" class="memberSummary" summary="Constructor Summary table, listing constructors, and an explanation">
<caption>
<span>构造方法</span>
<span class="tabEnd"> </span>
</caption>
<tbody>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../javax/swing/text/StyledEditorKit.StyledTextAction.html#StyledTextAction-java.lang.String-">StyledTextAction</a></span>(<a href="../../../java/lang/String.html" title="class in java.lang">String</a> nm)</code>
<div class="block">
从字符串操作名称创建一个新的StyledTextAction。
</div> </td>
</tr>
</tbody>
</table> </li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- --> </a> <h3>方法摘要</h3>
<table border="0" cellpadding="3" cellspacing="0" class="memberSummary" summary="Method Summary table, listing methods, and an explanation">
<caption>
<span class="activeTableTab" id="t0"><span>所有方法</span><span class="tabEnd"> </span></span>
<span class="tableTab" id="t2"><span><a href="javascript:show(2);">接口方法</a></span><span class="tabEnd"> </span></span>
<span class="tableTab" id="t4"><span><a href="javascript:show(8);">具体的方法</a></span><span class="tabEnd"> </span></span>
</caption>
<tbody>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor" id="i0">
<td class="colFirst"><code>protected <a href="../../../javax/swing/JEditorPane.html" title="class in javax.swing">JEditorPane</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/text/StyledEditorKit.StyledTextAction.html#getEditor-java.awt.event.ActionEvent-">getEditor</a></span>(<a href="../../../java/awt/event/ActionEvent.html" title="class in java.awt.event">ActionEvent</a> e)</code>
<div class="block">
获取操作的目标编辑器。
</div> </td>
</tr>
<tr class="rowColor" id="i1">
<td class="colFirst"><code>protected <a href="../../../javax/swing/text/StyledDocument.html" title="interface in javax.swing.text">StyledDocument</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/text/StyledEditorKit.StyledTextAction.html#getStyledDocument-javax.swing.JEditorPane-">getStyledDocument</a></span>(<a href="../../../javax/swing/JEditorPane.html" title="class in javax.swing">JEditorPane</a> e)</code>
<div class="block">
获取与编辑器窗格关联的文档。
</div> </td>
</tr>
<tr class="altColor" id="i2">
<td class="colFirst"><code>protected <a href="../../../javax/swing/text/StyledEditorKit.html" title="class in javax.swing.text">StyledEditorKit</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/text/StyledEditorKit.StyledTextAction.html#getStyledEditorKit-javax.swing.JEditorPane-">getStyledEditorKit</a></span>(<a href="../../../javax/swing/JEditorPane.html" title="class in javax.swing">JEditorPane</a> e)</code>
<div class="block">
获取与编辑器窗格相关联的编辑工具包。
</div> </td>
</tr>
<tr class="rowColor" id="i3">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/text/StyledEditorKit.StyledTextAction.html#setCharacterAttributes-javax.swing.JEditorPane-javax.swing.text.AttributeSet-boolean-">setCharacterAttributes</a></span>(<a href="../../../javax/swing/JEditorPane.html" title="class in javax.swing">JEditorPane</a> editor, <a href="../../../javax/swing/text/AttributeSet.html" title="interface in javax.swing.text">AttributeSet</a> attr, boolean replace)</code>
<div class="block">
将给定的属性应用于字符内容。
</div> </td>
</tr>
<tr class="altColor" id="i4">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/text/StyledEditorKit.StyledTextAction.html#setParagraphAttributes-javax.swing.JEditorPane-javax.swing.text.AttributeSet-boolean-">setParagraphAttributes</a></span>(<a href="../../../javax/swing/JEditorPane.html" title="class in javax.swing">JEditorPane</a> editor, <a href="../../../javax/swing/text/AttributeSet.html" title="interface in javax.swing.text">AttributeSet</a> attr, boolean replace)</code>
<div class="block">
将给定的属性应用于段落。
</div> </td>
</tr>
</tbody>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.javax.swing.text.TextAction">
<!-- --> </a> <h3>Methods inherited from class javax.swing.text.<a href="../../../javax/swing/text/TextAction.html" title="class in javax.swing.text">TextAction</a></h3> <code><a href="../../../javax/swing/text/TextAction.html#augmentList-javax.swing.Action:A-javax.swing.Action:A-">augmentList</a>, <a href="../../../javax/swing/text/TextAction.html#getFocusedComponent--">getFocusedComponent</a>, <a href="../../../javax/swing/text/TextAction.html#getTextComponent-java.awt.event.ActionEvent-">getTextComponent</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.javax.swing.AbstractAction">
<!-- --> </a> <h3>Methods inherited from class javax.swing.<a href="../../../javax/swing/AbstractAction.html" title="class in javax.swing">AbstractAction</a></h3> <code><a href="../../../javax/swing/AbstractAction.html#addPropertyChangeListener-java.beans.PropertyChangeListener-">addPropertyChangeListener</a>, <a href="../../../javax/swing/AbstractAction.html#clone--">clone</a>, <a href="../../../javax/swing/AbstractAction.html#firePropertyChange-java.lang.String-java.lang.Object-java.lang.Object-">firePropertyChange</a>, <a href="../../../javax/swing/AbstractAction.html#getKeys--">getKeys</a>, <a href="../../../javax/swing/AbstractAction.html#getPropertyChangeListeners--">getPropertyChangeListeners</a>, <a href="../../../javax/swing/AbstractAction.html#getValue-java.lang.String-">getValue</a>, <a href="../../../javax/swing/AbstractAction.html#isEnabled--">isEnabled</a>, <a href="../../../javax/swing/AbstractAction.html#putValue-java.lang.String-java.lang.Object-">putValue</a>, <a href="../../../javax/swing/AbstractAction.html#removePropertyChangeListener-java.beans.PropertyChangeListener-">removePropertyChangeListener</a>, <a href="../../../javax/swing/AbstractAction.html#setEnabled-boolean-">setEnabled</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- --> </a> <h3>Methods inherited from class java.lang.<a href="../../../java/lang/Object.html" title="class in java.lang">Object</a></h3> <code><a href="../../../java/lang/Object.html#equals-java.lang.Object-">equals</a>, <a href="../../../java/lang/Object.html#finalize--">finalize</a>, <a href="../../../java/lang/Object.html#getClass--">getClass</a>, <a href="../../../java/lang/Object.html#hashCode--">hashCode</a>, <a href="../../../java/lang/Object.html#notify--">notify</a>, <a href="../../../java/lang/Object.html#notifyAll--">notifyAll</a>, <a href="../../../java/lang/Object.html#toString--">toString</a>, <a href="../../../java/lang/Object.html#wait--">wait</a>, <a href="../../../java/lang/Object.html#wait-long-">wait</a>, <a href="../../../java/lang/Object.html#wait-long-int-">wait</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.awt.event.ActionListener">
<!-- --> </a> <h3>Methods inherited from interface java.awt.event.<a href="../../../java/awt/event/ActionListener.html" title="interface in java.awt.event">ActionListener</a></h3> <code><a href="../../../java/awt/event/ActionListener.html#actionPerformed-java.awt.event.ActionEvent-">actionPerformed</a></code></li>
</ul> </li>
</ul> </li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- --> </a> <h3>构造方法详细信息</h3> <a name="StyledTextAction-java.lang.String-">
<!-- --> </a>
<ul class="blockListLast">
<li class="blockList"> <h4>StyledTextAction</h4> <pre>public StyledTextAction(<a href="../../../java/lang/String.html" title="class in java.lang">String</a> nm)</pre>
<div class="block">
从字符串操作名称创建一个新的StyledTextAction。
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>nm</code> - 动作的名称
</dd>
</dl> </li>
</ul> </li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- --> </a> <h3>方法详细信息</h3> <a name="getEditor-java.awt.event.ActionEvent-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getEditor</h4> <pre>protected final <a href="../../../javax/swing/JEditorPane.html" title="class in javax.swing">JEditorPane</a> getEditor(<a href="../../../java/awt/event/ActionEvent.html" title="class in java.awt.event">ActionEvent</a> e)</pre>
<div class="block">
获取操作的目标编辑器。
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>e</code> - 动作事件
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
编辑
</dd>
</dl> </li>
</ul> <a name="getStyledDocument-javax.swing.JEditorPane-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getStyledDocument</h4> <pre>protected final <a href="../../../javax/swing/text/StyledDocument.html" title="interface in javax.swing.text">StyledDocument</a> getStyledDocument(<a href="../../../javax/swing/JEditorPane.html" title="class in javax.swing">JEditorPane</a> e)</pre>
<div class="block">
获取与编辑器窗格关联的文档。
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>e</code> - 编辑
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
文件
</dd>
<dt>
<span class="throwsLabel">异常</span>
</dt>
<dd>
<code><a href="../../../java/lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</a></code> - 对于错误的文档类型
</dd>
</dl> </li>
</ul> <a name="getStyledEditorKit-javax.swing.JEditorPane-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getStyledEditorKit</h4> <pre>protected final <a href="../../../javax/swing/text/StyledEditorKit.html" title="class in javax.swing.text">StyledEditorKit</a> getStyledEditorKit(<a href="../../../javax/swing/JEditorPane.html" title="class in javax.swing">JEditorPane</a> e)</pre>
<div class="block">
获取与编辑器窗格相关联的编辑工具包。
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>e</code> - 编辑器窗格
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
该套件
</dd>
<dt>
<span class="throwsLabel">异常</span>
</dt>
<dd>
<code><a href="../../../java/lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</a></code> - 对于错误的文档类型
</dd>
</dl> </li>
</ul> <a name="setCharacterAttributes-javax.swing.JEditorPane-javax.swing.text.AttributeSet-boolean-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>setCharacterAttributes</h4> <pre>protected final void setCharacterAttributes(<a href="../../../javax/swing/JEditorPane.html" title="class in javax.swing">JEditorPane</a> editor,
<a href="../../../javax/swing/text/AttributeSet.html" title="interface in javax.swing.text">AttributeSet</a> attr,
boolean replace)</pre>
<div class="block">
<span>将给定的属性应用于字符内容。</span>
<span>如果有选择,属性将应用于选择范围。</span>
<span>如果没有选择,属性将应用于输入属性集,该属性集定义了任何插入的新文本的属性。</span>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>editor</code> - 编辑
</dd>
<dd>
<code>attr</code> - 属性
</dd>
<dd>
<code>replace</code> - 如果为true则先替换现有属性
</dd>
</dl> </li>
</ul> <a name="setParagraphAttributes-javax.swing.JEditorPane-javax.swing.text.AttributeSet-boolean-">
<!-- --> </a>
<ul class="blockListLast">
<li class="blockList"> <h4>setParagraphAttributes</h4> <pre>protected final void setParagraphAttributes(<a href="../../../javax/swing/JEditorPane.html" title="class in javax.swing">JEditorPane</a> editor,
<a href="../../../javax/swing/text/AttributeSet.html" title="interface in javax.swing.text">AttributeSet</a> attr,
boolean replace)</pre>
<div class="block">
<span>将给定的属性应用于段落。</span>
<span>如果有选择,属性将应用于与选择相交的段落。</span>
<span>如果没有选择,属性将应用于当前插入符位置的段落。</span>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>editor</code> - 编辑
</dd>
<dd>
<code>attr</code> - 属性
</dd>
<dd>
<code>replace</code> - if true, replace the existing attributes first
</dd>
</dl> </li>
</ul> </li>
</ul> </li>
</ul>
</div>
</div>