javax.swing.text
Class InternationalFormatter.ExtendedReplaceHolder

java.lang.Object
  extended byjavax.swing.text.DefaultFormatter.ReplaceHolder
      extended byjavax.swing.text.InternationalFormatter.ExtendedReplaceHolder
Enclosing class:
InternationalFormatter

static class InternationalFormatter.ExtendedReplaceHolder
extends DefaultFormatter.ReplaceHolder

As InternationalFormatter replaces the complete text on every edit, ExtendedReplaceHolder keeps track of the offset and length passed into canReplace.


Field Summary
(package private)  AttributeSet attrs
          AttributeSet to attach to text, may be null.
(package private)  int cursorPosition
          Position the cursor should be adjusted from.
(package private)  int endOffset
          Offset of the insert/remove.
(package private)  int endTextLength
          Length of the text.
(package private)  DocumentFilter.FilterBypass fb
          The FilterBypass that was passed to the DocumentFilter method.
(package private)  int length
          Length of text to remove.
(package private)  int offset
          Offset where the remove/insert is going to occur.
(package private)  String text
          The text to insert, may be null.
(package private)  Object value
          The resulting value, this may never be set.
 
Constructor Summary
(package private) InternationalFormatter.ExtendedReplaceHolder()
           
 
Method Summary
(package private)  void reset(DocumentFilter.FilterBypass fb, int offset, int length, String text, AttributeSet attrs)
           
(package private)  void resetFromValue(InternationalFormatter formatter)
          Resets the region to delete to be the complete document and the text from invoking valueToString on the current value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

endOffset

int endOffset
Offset of the insert/remove. This may differ from offset in that if !allowsInvalid the text is replaced on every edit.


endTextLength

int endTextLength
Length of the text. This may differ from text.length in that if !allowsInvalid the text is replaced on every edit.


fb

DocumentFilter.FilterBypass fb
The FilterBypass that was passed to the DocumentFilter method.


offset

int offset
Offset where the remove/insert is going to occur.


length

int length
Length of text to remove.


text

String text
The text to insert, may be null.


attrs

AttributeSet attrs
AttributeSet to attach to text, may be null.


value

Object value
The resulting value, this may never be set.


cursorPosition

int cursorPosition
Position the cursor should be adjusted from. If this is -1 the cursor position will be adjusted based on the direction of the replace (-1: offset, 1: offset + text.length()), otherwise the cursor position is adusted from this position.

Constructor Detail

InternationalFormatter.ExtendedReplaceHolder

InternationalFormatter.ExtendedReplaceHolder()
Method Detail

resetFromValue

void resetFromValue(InternationalFormatter formatter)
Resets the region to delete to be the complete document and the text from invoking valueToString on the current value.


reset

void reset(DocumentFilter.FilterBypass fb,
           int offset,
           int length,
           String text,
           AttributeSet attrs)