JavaTM Platform
Standard Ed. 6

javax.swing.text
クラス StyledEditorKit

java.lang.Object
  上位を拡張 javax.swing.text.EditorKit
      上位を拡張 javax.swing.text.DefaultEditorKit
          上位を拡張 javax.swing.text.StyledEditorKit
すべての実装されたインタフェース:
Serializable, Cloneable
直系の既知のサブクラス:
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, deleteNextWordAction, deletePrevCharAction, deletePrevWordAction, 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()
          書式付きドキュメントで使用する新しい EditorKit を作成します。
 
メソッドの概要
 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()
書式付きドキュメントで使用する新しい EditorKit を作成します。

メソッドの詳細

getInputAttributes

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

戻り値:
属性セット

getCharacterAttributeRun

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

戻り値:
要素

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
戻り値:
ファクトリ

clone

public Object clone()
編集キットのコピーを作成します。

オーバーライド:
クラス EditorKit 内の clone
戻り値:
コピー
関連項目:
Cloneable

createInputAttributes

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

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


JavaTM Platform
Standard Ed. 6

バグの報告と機能のリクエスト
さらに詳しい API リファレンスおよび開発者ドキュメントについては、Java SE 開発者用ドキュメントを参照してください。開発者向けの詳細な解説、概念の概要、用語の定義、バグの回避策、およびコード実例が含まれています。

Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。