com.threerings.opengl.gui.text
Class IntegerDocument

java.lang.Object
  extended by com.threerings.opengl.gui.text.Document
      extended by com.threerings.opengl.gui.text.IntegerDocument

public class IntegerDocument
extends Document

A document for use with a TextField that allows only integer numeric input. Note: to allow fully valid values to be entered one character at a time, partially valid values (like the string '-' at position zero) must be allowed. Thus one cannot rely on the integer document only ever containing valid integers.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.threerings.opengl.gui.text.Document
Document.Listener
 
Constructor Summary
IntegerDocument()
          Creates a new document that allows any integer value.
IntegerDocument(boolean positive)
          Creates a new integer document.
 
Method Summary
 
Methods inherited from class com.threerings.opengl.gui.text.Document
addListener, addUndoableEditListener, getLength, getText, getText, getWordExtents, indexOfWordEnd, insert, lastIndexOfWordStart, remove, removeListener, removeUndoableEditListener, replace, setText
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntegerDocument

public IntegerDocument()
Creates a new document that allows any integer value.


IntegerDocument

public IntegerDocument(boolean positive)
Creates a new integer document.

Parameters:
positive - if true, only accept positive values


Copyright © 2011. All Rights Reserved.