Java プラットフォーム 1.2

javax.swing.text
クラス StyledEditorKit.StyledTextAction

java.lang.Object
  |
  +--javax.swing.AbstractAction
        |
        +--javax.swing.text.TextAction
              |
              +--javax.swing.text.StyledEditorKit.StyledTextAction
直接の既知のサブクラス:
HTMLEditorKit.HTMLTextAction, StyledEditorKit.AlignmentAction, StyledEditorKit.BoldAction, StyledEditorKit.FontFamilyAction, StyledEditorKit.FontSizeAction, StyledEditorKit.ForegroundAction, StyledEditorKit.ItalicAction, StyledEditorKit.UnderlineAction

public abstract static class StyledEditorKit.StyledTextAction
extends TextAction

StyledEditorKit (またはサブクラス) がインストールされている JEditorPane で発生することを前提とするアクションです。このアクションには、文字または段落レベルの属性に変更を生じさせるいくつかの便利なメソッドがあります。これらの便利なメソッドは、StyledDocument、JEditorPane、または StyledEditorKit の前提が true にならない場合に IllegalArgumentException をスローします。

このアクションが作用するコンポーネントは、ActionEvent のソースになります (ソースが JEditorPane 型に縮小できる場合)。ソースが縮小できない場合は、一番新しくフォーカスを持ったテキストコンポーネントが変更されます。どちらでもない場合、アクションは実行できません。

警告: このクラスの直列化されたオブジェクトは、今後の Swing リリースと互換ではなくなる予定です。現在の直列化のサポートは、短期間の運用や、同じバージョンの Swing を実行するアプリケーション間の RMI に適しています。今後の Swing リリースでは、長期間の持続性をサポートする予定です。

関連項目:
直列化された形式

クラス javax.swing.AbstractAction から継承したフィールド
changeSupport, enabled
 
コンストラクタの概要
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, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
クラス java.lang.Object から継承したメソッド
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

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 の場合、既存の属性が最初に置き換えられる

Java プラットフォーム 1.2

バグや機能要求の報告
新しい javadoc の表示についてのコメントやご提案
Java は、米国およびその他の国における米国 Sun Microsystems, Inc. の商標もしくは登録商標です。
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.