クラス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
  • コンストラクタのサマリー

    コンストラクタ
    修飾子
    コンストラクタ
    説明
    protected
    サブクラスが呼び出すためのコンストラクタ。
  • メソッドのサマリー

    修飾子と型
    メソッド
    説明
    abstract Document
    変更が行われている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に置き換えます。

    クラスオブジェクトで宣言されたメソッド

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    修飾子と型
    メソッド
    説明
    protected Object
    このオブジェクトのコピーを作成して、返します。
    boolean
    このオブジェクトと他のオブジェクトが等しいかどうかを示します。
    protected void
    削除予定のため非推奨: このAPI要素は、将来のバージョンで削除される可能性があります。
    最終決定は非推奨であり、将来のリリースで削除される可能性があります。
    final Class<?>
    このObjectの実行時クラスを返します。
    int
    このオブジェクトに対するハッシュ・コード値を返します。
    final void
    このオブジェクトのモニターで待機中のスレッドを1つ再開します。
    final void
    このオブジェクトのモニターで待機中のすべてのスレッドを再開します。
    オブジェクトの文字列表現を返します。
    final void
    現在のスレッドが目覚めるまで待機します。通常、notifiedまたはinterruptedです。
    final void
    wait(long timeoutMillis)
    現在のスレッドは、通常、notifiedまたはinterruptedであるか、一定のリアルタイムが経過するまで、目覚めるまで待機します。
    final void
    wait(long timeoutMillis, int nanos)
    現在のスレッドは、通常、notifiedまたはinterruptedであるか、一定のリアルタイムが経過するまで、目覚めるまで待機します。
  • コンストラクタの詳細

    • FilterBypass

      protected 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 - 指定された挿入位置がドキュメント内の有効な位置でない場合