Java プラットフォーム 1.2

javax.swing.text
クラス StyledEditorKit

java.lang.Object
  |
  +--javax.swing.text.EditorKit
        |
        +--javax.swing.text.DefaultEditorKit
              |
              +--javax.swing.text.StyledEditorKit
直接の既知のサブクラス:
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()
エディタキットのコピーを作成します。ある実装がほかの実装のプロトタイプとなるため、それらの実装を迅速に作成できます。
戻り値:
コピー
オーバーライド:
クラス DefaultEditorKit 内の clone

getActions

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

createDefaultDocument

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

install

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

deinstall

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

getViewFactory

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

createInputAttributes

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

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


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.