JavaTM 2 Platform
Std. Ed. v1.3

javax.swing.text
クラス StyledEditorKit

java.lang.Object
  |
  +--javax.swing.text.EditorKit
        |
        +--javax.swing.text.DefaultEditorKit
              |
              +--javax.swing.text.StyledEditorKit
すべての実装インタフェース:
Cloneable, Serializable
直系の既知のサブクラス:
HTMLEditorKit, RTFEditorKit

public class StyledEditorKit
extends DefaultEditorKit

特定のタイプのテキストドキュメントに対して適切なエディタとして機能するために、テキストコンポーネントに必要なセットです。この実装は、テキストを書式付きテキストとして処理し、書式付きテキストを編集するためのアクションの最小セットを提供するデフォルトの実装を提供します。

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

内部クラスの概要
static class StyledEditorKit.AlignmentAction
          段落の配置方法を設定するアクションです。
static class StyledEditorKit.BoldAction
          ボールド属性を切り替えるアクションです。
static class StyledEditorKit.FontFamilyAction
          関連した JEditorPane でフォントファミリを設定するアクションです。
static class StyledEditorKit.FontSizeAction
          関連した JEditorPane でフォントサイズを設定するアクションです。
static class StyledEditorKit.ForegroundAction
          フォアグラウンドカラーを設定するアクションです。
static class StyledEditorKit.ItalicAction
          イタリック属性を切り替えるアクションです。
static class StyledEditorKit.StyledTextAction
          StyledEditorKit (またはサブクラス) がインストールされている JEditorPane で発生することを前提とするアクションです。
static class StyledEditorKit.UnderlineAction
          下線属性を切り替えるアクションです。
 
クラス javax.swing.text.DefaultEditorKit から継承した内部クラス
DefaultEditorKit.BeepAction, DefaultEditorKit.CopyAction, DefaultEditorKit.CutAction, DefaultEditorKit.DefaultKeyTypedAction, DefaultEditorKit.InsertBreakAction, DefaultEditorKit.InsertContentAction, DefaultEditorKit.InsertTabAction, DefaultEditorKit.PasteAction
 
クラス javax.swing.text.DefaultEditorKit から継承したフィールド
backwardAction, beepAction, beginAction, beginLineAction, beginParagraphAction, beginWordAction, copyAction, cutAction, defaultKeyTypedAction, deleteNextCharAction, deletePrevCharAction, downAction, endAction, endLineAction, EndOfLineStringProperty, endParagraphAction, endWordAction, forwardAction, insertBreakAction, insertContentAction, insertTabAction, nextWordAction, pageDownAction, pageUpAction, pasteAction, previousWordAction, readOnlyAction, selectAllAction, selectionBackwardAction, selectionBeginAction, selectionBeginLineAction, selectionBeginParagraphAction, selectionBeginWordAction, selectionDownAction, selectionEndAction, selectionEndLineAction, selectionEndParagraphAction, selectionEndWordAction, selectionForwardAction, selectionNextWordAction, selectionPreviousWordAction, selectionUpAction, selectLineAction, selectParagraphAction, selectWordAction, upAction, writableAction
 
コンストラクタの概要
StyledEditorKit()
           
 
メソッドの概要
 Object clone()
          エディタキットのコピーを作成します。
 Document createDefaultDocument()
          このタイプのエディタに適している未初期化テキストストレージモデルを作成します。
protected  void createInputAttributes(Element element, MutableAttributeSet set)
          element の AttributeSet 内のキーと値のペアを set にコピーします。
 void deinstall(JEditorPane c)
          キットが JEditorPane から削除されているときに呼び出されます。
 Action[] getActions()
          エディタのコマンドリストを取り出します。
 Element getCharacterAttributeRun()
          キャレットに対応する現在の文字属性を表す要素を取り出します。
 MutableAttributeSet getInputAttributes()
          区画の入力属性を返します。
 ViewFactory getViewFactory()
          このキットで作成されるモデルのビューを作成するのに適したファクトリを取り出します。
 void install(JEditorPane c)
          キットが JEditorPane にインストールされているときに呼び出されます。
 
クラス javax.swing.text.DefaultEditorKit から継承したメソッド
createCaret, getContentType, read, read, write, write
 
クラス java.lang.Object から継承したメソッド
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

StyledEditorKit

public StyledEditorKit()
メソッドの詳細

getInputAttributes

public MutableAttributeSet getInputAttributes()
区画の入力属性を返します。キャレットが移動し、選択がない場合、入力属性は現在のキャレット位置の文字属性を反映するために自動的に変更されます。書式付き編集アクションは、入力属性を使用してアクションを実行します。
戻り値:
属性セット

getCharacterAttributeRun

public Element getCharacterAttributeRun()
キャレットに対応する現在の文字属性を表す要素を取り出します。
戻り値:
要素

clone

public Object clone()
エディタキットのコピーを作成します。ある実装がほかの実装のプロトタイプとなるため、それらの実装を迅速に作成できます。
オーバーライド:
クラス EditorKit 内の clone
戻り値:
コピー

getActions

public Action[] getActions()
エディタのコマンドリストを取り出します。これは、書式処理のためにローカルで定義されたコマンドのコレクションによって追加されたスーパークラスによってサポートされるコマンドのリストです。
オーバーライド:
クラス DefaultEditorKit 内の getActions
戻り値:
コマンドリスト

createDefaultDocument

public Document createDefaultDocument()
このタイプのエディタに適している未初期化テキストストレージモデルを作成します。
オーバーライド:
クラス DefaultEditorKit 内の createDefaultDocument
戻り値:
モデル

install

public void install(JEditorPane c)
キットが JEditorPane にインストールされているときに呼び出されます。
オーバーライド:
クラス EditorKit 内の install
パラメータ:
c - JEditorPane

deinstall

public void deinstall(JEditorPane c)
キットが JEditorPane から削除されているときに呼び出されます。このメソッドは、追加されたリスナーの登録を解除するために使用されます。
オーバーライド:
クラス EditorKit 内の deinstall
パラメータ:
c - JEditorPane

getViewFactory

public ViewFactory getViewFactory()
このキットで作成されるモデルのビューを作成するのに適したファクトリを取り出します。これは、以下のタイプの要素について View の実装を返すために実装されます。
オーバーライド:
クラス DefaultEditorKit 内の getViewFactory
戻り値:
ファクトリ

createInputAttributes

protected void createInputAttributes(Element element,
                                     MutableAttributeSet set)
element の AttributeSet 内のキーと値のペアを set にコピーします。このメソッドは、コンポーネント、アイコン、要素名の各属性はコピーしません。サブクラスでは、どの属性をコピーしてどの属性をコピーしないかを変更することもできます。ただし、最初に set 内のすべての属性を必ず削除してください。

このメソッドは、キャレットが別の位置に移動するたびに呼び出されます。


JavaTM 2 Platform
Std. Ed. v1.3

バグや機能要求の報告
さらに詳しい 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.