- 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
-
-
-
-
メソッドの詳細
-
getInputAttributes
public MutableAttributeSet getInputAttributes()
ペインの入力属性を返します。 キャレットが移動し、選択がない場合、入力属性は現在のキャレット位置の文字属性を反映するために自動的に変更されます。 書式付き編集アクションは、入力属性を使用してアクションを実行します。- 戻り値:
- 属性セット
-
getCharacterAttributeRun
public Element getCharacterAttributeRun()
キャレットに対応する現在の文字属性を表す要素を取得します。- 戻り値:
- 要素
-
getActions
public Action[] getActions()
エディタのコマンド・リストを取り出します。 これは、書式処理のためにローカルで定義されたコマンドのコレクションによって追加されたスーパー・クラスによってサポートされるコマンドのリストです。- オーバーライド:
getActions
、クラス:DefaultEditorKit
- 戻り値:
- コマンド・リスト
-
createDefaultDocument
public Document createDefaultDocument()
この型のエディタに適している未初期化テキスト・ストレージ・モデルを作成します。- オーバーライド:
createDefaultDocument
、クラス:DefaultEditorKit
- 戻り値:
- モデル
-
install
public void install(JEditorPane c)
キットがJEditorPaneにインストールされているときに呼び出されます。
-
deinstall
public void deinstall(JEditorPane c)
キットがJEditorPaneから削除されているときに呼び出されます。 このメソッドは、追加されたリスナーの登録を解除するために使用されます。
-
getViewFactory
public ViewFactory getViewFactory()
このキットが作成した任意のモデルのビューを作成するのに適したファクトリを取得します。 これは、次のタイプの要素についてViewの実装を返すために実装されます。- AbstractDocument.ContentElementName
- AbstractDocument.ParagraphElementName
- AbstractDocument.SectionElementName
- StyleConstants.ComponentElementName
- StyleConstants.IconElementName
- オーバーライド:
getViewFactory
、クラス:DefaultEditorKit
- 戻り値:
- ファクトリ
-
createInputAttributes
protected void createInputAttributes(Element element, MutableAttributeSet set)
element
のAttributeSet内のキーと値のペアをset
にコピーします。 このメソッドは、コンポーネント、アイコン、要素名の各属性はコピーしません。 サブクラスでは、どの属性をコピーしてどの属性をコピーしないかを変更することもできます。 ただし、最初にset
内のすべての属性を必ず削除してください。このメソッドは、キャレットが別の位置に移動するたびに呼び出されます。
- パラメータ:
element
- 要素set
- 属性
-
-