javax.swing.text
クラス StyledEditorKit.StyledTextAction
java.lang.Object
|
+--javax.swing.AbstractAction
|
+--javax.swing.text.TextAction
|
+--javax.swing.text.StyledEditorKit.StyledTextAction
- すべての実装インタフェース:
- Action, ActionListener, Cloneable, EventListener, Serializable
- 直系の既知のサブクラス:
- HTMLEditorKit.HTMLTextAction, StyledEditorKit.AlignmentAction, StyledEditorKit.BoldAction, StyledEditorKit.FontFamilyAction, StyledEditorKit.FontSizeAction, StyledEditorKit.ForegroundAction, StyledEditorKit.ItalicAction, StyledEditorKit.UnderlineAction
- 含まれているクラス:
- StyledEditorKit
- public abstract static class StyledEditorKit.StyledTextAction
- extends TextAction
StyledEditorKit (またはサブクラス) がインストールされている JEditorPane で発生することを前提とするアクションです。このアクションには、文字または段落レベルの属性に変更を生じさせるいくつかの便利なメソッドがあります。これらの便利なメソッドは、StyledDocument、JEditorPane、または StyledEditorKit の前提が true にならない場合に IllegalArgumentException をスローします。
このアクションが作用するコンポーネントは、ActionEvent のソースになります (ソースが JEditorPane 型に縮小できる場合)。ソースが縮小できない場合は、一番新しくフォーカスを持ったテキストコンポーネントが変更されます。どちらでもない場合、アクションは実行できません。
警告:
このクラスの直列化されたオブジェクトは、今後の Swing リリースと互換ではなくなる予定です。現在の直列化のサポートは、短期間の運用や、同じバージョンの Swing を実行するアプリケーション間の RMI に適しています。今後の Swing リリースでは、長期間の持続性をサポートする予定です。
- 関連項目:
- 直列化された形式
StyledEditorKit.StyledTextAction
public StyledEditorKit.StyledTextAction(String nm)
- 文字列のアクション名から新しい StyledTextAction を作成します。
- パラメータ:
nm
- アクションの名前
getEditor
protected final JEditorPane getEditor(ActionEvent e)
- アクションのターゲットエディタを取得します。
- パラメータ:
e
- アクションイベント- 戻り値:
- エディタ
getStyledDocument
protected final StyledDocument getStyledDocument(JEditorPane e)
- エディタ区画に関連したドキュメントを取得します。
- パラメータ:
e
- エディタ- 戻り値:
- ドキュメント
- 例外:
IllegalArgumentException
- ドキュメントのタイプが違う場合
getStyledEditorKit
protected final StyledEditorKit getStyledEditorKit(JEditorPane e)
- エディタ区画に関連したエディタキットを取得します。
- パラメータ:
e
- エディタ区画- 戻り値:
- キット
- 例外:
IllegalArgumentException
- ドキュメントのタイプが違う場合
setCharacterAttributes
protected final void setCharacterAttributes(JEditorPane editor,
AttributeSet attr,
boolean replace)
- 指定された属性を文字コンテンツに適用します。選択がある場合、属性はその選択範囲に適用されます。選択がない場合、属性は、挿入される新しいテキストの属性を定義する入力属性セットに適用されます。
- パラメータ:
editor
- エディタattr
- 属性replace
- true の場合、既存の属性が最初に置き換えられる
setParagraphAttributes
protected final void setParagraphAttributes(JEditorPane editor,
AttributeSet attr,
boolean replace)
- 指定された属性を段落に適用します。選択がある場合、属性はその選択と交わる段落に適用されます。選択がない場合、属性は現在のキャレット位置にある段落に適用されます。
- パラメータ:
editor
- エディタattr
- 属性replace
- true の場合、既存の属性が最初に置き換えられる
バグや機能要求の報告
さらに詳しい API リファレンスおよび開発者ドキュメントについては、 Java 2 SDK SE Developer Documentation を参照してください。このドキュメントには、概念、用語の定義、回避策、 実用的なコード例など、開発者を対象にした詳細な解説が掲載されています。 Java、Java 2D、JDBC は、米国およびその他の国における米国 Sun Microsystems, Inc. の商標もしくは登録商標です。
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.