JavaTM Platform
Standard Ed. 6

javax.swing.text
クラス DocumentFilter.FilterBypass

java.lang.Object
  上位を拡張 javax.swing.text.DocumentFilter.FilterBypass
含まれているクラス:
DocumentFilter

public abstract static class DocumentFilter.FilterBypass
extends Object

Document へのコールバックを回避して、Document を変更する場合に使用されます。DocumentFilter をサポートする Document 実装では、以下のメソッドが DocumentFilter から呼び出されたときに、DocumentFilter へのコールバックを実行しないようにする必要があります。

導入されたバージョン:
1.4

コンストラクタの概要
DocumentFilter.FilterBypass()
           
 
メソッドの概要
abstract  Document getDocument()
          変更が行われている Document を返します。
abstract  void insertString(int offset, String string, AttributeSet attr)
          DocumentFilter をバイパスして、指定テキストを挿入します。
abstract  void remove(int offset, int length)
          DocumentFilter をバイパスして、テキストの指定領域を削除します。
abstract  void replace(int offset, int length, String string, AttributeSet attrs)
          offset から offset + length までのテキスト領域を削除し、text に置き換えます。
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

DocumentFilter.FilterBypass

public DocumentFilter.FilterBypass()
メソッドの詳細

getDocument

public abstract Document getDocument()
変更が行われている Document を返します。

戻り値:
removeString や insertString が実行される Document

remove

public abstract void remove(int offset,
                            int length)
                     throws BadLocationException
DocumentFilter をバイパスして、テキストの指定領域を削除します。

パラメータ:
offset - 先頭からのオフセット >= 0
length - 削除対象の文字数 >= 0
例外:
BadLocationException - 削除範囲の一部がドキュメントの有効な部分でなかった場合。 例外内の位置は、 最初に検出された不正な位置

insertString

public abstract void insertString(int offset,
                                  String string,
                                  AttributeSet attr)
                           throws BadLocationException
DocumentFilter をバイパスして、指定テキストを挿入します。

パラメータ:
offset - コンテンツを挿入するドキュメント内のオフセット。0 以上。 指定位置やその後ろの変更を追跡する すべての位置が移動
string - 挿入する文字列
attr - 挿入されたコンテンツに関連付ける属性。 属性がない場合は null も可
例外:
BadLocationException - 指定された挿入位置が ドキュメント内の有効な位置でない場合

replace

public abstract void replace(int offset,
                             int length,
                             String string,
                             AttributeSet attrs)
                      throws BadLocationException
offset から offset + length までのテキスト領域を削除し、text に置き換えます。

パラメータ:
offset - Document での位置
length - 削除するテキストの長さ
string - 挿入するテキスト。null の場合、テキストは挿入されない
attrs - 挿入されたテキストの属性を示す AttributeSet。 null も可
例外:
BadLocationException - 指定された挿入位置が ドキュメント内の有効な位置でない場合

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 も参照してください。