public class PlainDocument extends AbstractDocument
デフォルトのコンテンツ記憶域管理は、ギャップ付きバッファの実装(GapContent)によって行われます。GapContentは、かなり大きなドキュメントの編集をサポートしており、隣接するまとまった領域に対する一般的な編集を効率よく処理できます。
警告: このクラスの直列化されたオブジェクトは、今後のSwingリリースとの互換性がなくなる予定です。現在の直列化のサポートは、短期間の格納や、同じバージョンのSwingを実行するアプリケーション間のRMIに適しています。1.4以降、すべてのJavaBeans(tm)用の長期間の格納サポートがjava.beansパッケージに追加されています。XMLEncoderを参照してください。
Document, AbstractDocumentAbstractDocument.AbstractElement, AbstractDocument.AttributeContext, AbstractDocument.BranchElement, AbstractDocument.Content, AbstractDocument.DefaultDocumentEvent, AbstractDocument.ElementEdit, AbstractDocument.LeafElement| 修飾子と型 | フィールドと説明 |
|---|---|
static String |
lineLimitAttribute
最大長がある場合、1行の最大長を指定する属性の名前です。
|
static String |
tabSizeAttribute
コンテンツ内のタブのサイズを指定する属性の名前です。
|
BAD_LOCATION, BidiElementName, ContentElementName, ElementNameAttribute, listenerList, ParagraphElementName, SectionElementNameStreamDescriptionProperty, TitleProperty| コンストラクタと説明 |
|---|
PlainDocument()
プレーン・テキスト・ドキュメントを構築します。
|
PlainDocument(AbstractDocument.Content c)
プレーン・テキスト・ドキュメントを構築します。
|
| 修飾子と型 | メソッドと説明 |
|---|---|
protected AbstractDocument.AbstractElement |
createDefaultRoot()
デフォルトのドキュメント構造を表すために使うルート要素を作成します。
|
Element |
getDefaultRootElement()
ドキュメント・モデルのデフォルトのルート要素を取得します。
|
Element |
getParagraphElement(int pos)
指定された位置を保持する段落要素を取得します。
|
void |
insertString(int offs, String str, AttributeSet a)
ドキュメントに内容を挿入します。
|
protected void |
insertUpdate(AbstractDocument.DefaultDocumentEvent chng, AttributeSet attr)
ドキュメント構造をテキスト挿入の結果で更新します。
|
protected void |
removeUpdate(AbstractDocument.DefaultDocumentEvent chng)
ドキュメント構造をテキスト削除の結果で更新します。
|
addDocumentListener, addUndoableEditListener, createBranchElement, createLeafElement, createPosition, dump, fireChangedUpdate, fireInsertUpdate, fireRemoveUpdate, fireUndoableEditUpdate, getAsynchronousLoadPriority, getAttributeContext, getBidiRootElement, getContent, getCurrentWriter, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, postRemoveUpdate, putProperty, readLock, readUnlock, remove, removeDocumentListener, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties, writeLock, writeUnlockpublic static final String tabSizeAttribute
public PlainDocument()
GapContentを使うデフォルト・モデルが構築されて、設定されます。public PlainDocument(AbstractDocument.Content c)
c - コンテンツのコンテナpublic void insertString(int offs,
String str,
AttributeSet a)
throws BadLocationException
このメソッドはスレッド・セーフですが、ほとんどのSwingメソッドは違います。詳細は、Swingでの並行性に関連しているサイトを参照してください。
insertString、インタフェース: DocumentinsertString、クラス: AbstractDocumentoffs - 開始オフセット>= 0str - 挿入する文字列。nullや空の文字列の場合は何もしないa - 挿入されたコンテンツの属性BadLocationException - 指定された挿入位置がドキュメント内の有効な位置でない場合Document.insertString(int, java.lang.String, javax.swing.text.AttributeSet)public Element getDefaultRootElement()
getDefaultRootElement、インタフェース: DocumentgetDefaultRootElement、クラス: AbstractDocumentDocument.getDefaultRootElement()protected AbstractDocument.AbstractElement createDefaultRoot()
public Element getParagraphElement(int pos)
getParagraphElement、クラス: AbstractDocumentpos - 開始オフセット>= 0protected void insertUpdate(AbstractDocument.DefaultDocumentEvent chng, AttributeSet attr)
insertUpdate、クラス: AbstractDocumentchng - 編集を記述する変更イベントattr - 挿入テキストの属性セットprotected void removeUpdate(AbstractDocument.DefaultDocumentEvent chng)
removeUpdate、クラス: AbstractDocumentchng - 編集を記述する変更イベント バグまたは機能を送信
詳細なAPIリファレンスおよび開発者ドキュメントについては、Java SEのドキュメントを参照してください。そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright© 1993, 2014, Oracle and/or its affiliates. All rights reserved.