All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.BSNumberTextFields.BSIntegerTextField

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.TextComponent
                   |
                   +----java.awt.TextField
                           |
                           +----COM.BSNumberTextFields.BSIntegerTextField

public class BSIntegerTextField
extends TextField
implements FocusListener, TextListener
A TextField which only allows its input to be the range of integer values acceptable for a Java primitive long. That range is -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.

Should a value be entered into the TextField which is not in range or contains non-digit characters the TextField will attempt to create a representation of the value which is within the range of long, if possible.

Note: The non-digit value '-' (the minus sign) is allowed. Its value is zero (0).

These bean properties can be used to modify the format the TextField will enforce: prefixString and suffixString.

prefixString: The String which will always appear at the beginning of the TextField.

suffixString: The String which will always appear at the end of the TextField.


Variable Index

 o fieldPrefixString
 o fieldSuffixString
 o ivjInputAsLong
 o javaVendor
 o propertyChange

Constructor Index

 o BSIntegerTextField()
Constructor
 o BSIntegerTextField(int)
BSIntegerTextField constructor comment.
 o BSIntegerTextField(String)
BSIntegerTextField constructor comment.
 o BSIntegerTextField(String, int)
BSIntegerTextField constructor comment.

Method Index

 o addPropertyChangeListener(PropertyChangeListener)
The addPropertyChangeListener method was generated to support the propertyChange field.
 o conn1(TextEvent)
conn1
 o conn4(FocusEvent)
conn4
 o firePropertyChange(String, Object, Object)
The firePropertyChange method was generated to support the propertyChange field.
 o focusGained(FocusEvent)
Method to handle events for the FocusListener interface.
 o focusLost(FocusEvent)
Method to handle events for the FocusListener interface.
 o getInputAs_long()
This method will return the Java primitive long value of the text presently in the TextField.
 o getInputAsLong()
Return the InputAsLong property value, the Long representation of the text currently in the TextField.
 o getMinimumSize()
Returns the minimum size Dimensions needed for this TextField.
 o getPreferredSize()
Returns the preferred size Dimensions needed for this TextField.
 o getPrefixString()
Gets the prefixStringproperty (java.lang.String) value.
 o getSuffixString()
Gets the suffixStringproperty (java.lang.String) value.
 o getTextAsString()
Returns the String value of what is currently in the TextField.
 o handleException(Throwable)
Called whenever the part throws an exception.
 o initConnections()
Initializes connections
 o initialize()
Initialize the class.
 o removePropertyChangeListener(PropertyChangeListener)
The removePropertyChangeListener method was generated to support the propertyChange field.
 o repaint(String, String)
This method determines if the TextField is currently displaying a valid value.
 o setCaretPosition(int)
Sets the position of the text insertion caret for the TextComponent
 o setInputAsLong(Long)
Set the InputAsLong to a new value.
 o setPrefixString(String)
Sets the prefixString property (java.lang.String) value.
 o setSuffixString(String)
Sets the suffixString property (java.lang.String) value.
 o textValueChanged(TextEvent)
Method to handle events for the TextListener interface.
 o typeSensitiveTextValueEnforcer(String)
This method ensures that the value entered by the user into the TextField conforms to the range of a Java primitive long.

Variables

 o fieldPrefixString
 protected String fieldPrefixString
 o fieldSuffixString
 protected String fieldSuffixString
 o ivjInputAsLong
 private Long ivjInputAsLong
 o javaVendor
 protected String javaVendor
 o propertyChange
 protected transient PropertyChangeSupport propertyChange

Constructors

 o BSIntegerTextField
 public BSIntegerTextField()
Constructor

 o BSIntegerTextField
 public BSIntegerTextField(int columns)
BSIntegerTextField constructor comment.

Parameters:
columns - int
 o BSIntegerTextField
 public BSIntegerTextField(String text)
BSIntegerTextField constructor comment.

Parameters:
text - java.lang.String
 o BSIntegerTextField
 public BSIntegerTextField(String text,
                           int columns)
BSIntegerTextField constructor comment.

Parameters:
text - java.lang.String
columns - int

Methods

 o addPropertyChangeListener
 public synchronized void addPropertyChangeListener(PropertyChangeListener listener)
The addPropertyChangeListener method was generated to support the propertyChange field.

Parameters:
listener - java.beans.PropertyChangeListener
 o conn1
 private void conn1(TextEvent arg1)
conn1

Parameters:
arg1 - java.awt.event.TextEvent
 o conn4
 private void conn4(FocusEvent arg1)
conn4

Parameters:
arg1 - java.awt.event.FocusEvent
 o firePropertyChange
 public void firePropertyChange(String propertyName,
                                Object oldValue,
                                Object newValue)
The firePropertyChange method was generated to support the propertyChange field.

Parameters:
propertyName - java.lang.String
oldValue - java.lang.Object
newValue - java.lang.Object
 o focusGained
 public void focusGained(FocusEvent e)
Method to handle events for the FocusListener interface.

Parameters:
e - java.awt.event.FocusEvent
 o focusLost
 public void focusLost(FocusEvent e)
Method to handle events for the FocusListener interface.

Parameters:
e - java.awt.event.FocusEvent
 o getInputAs_long
 public final long getInputAs_long()
This method will return the Java primitive long value of the text presently in the TextField.

Returns:
long
 o getInputAsLong
 public Long getInputAsLong()
Return the InputAsLong property value, the Long representation of the text currently in the TextField.

Returns:
java.lang.Long
 o getMinimumSize
 public Dimension getMinimumSize()
Returns the minimum size Dimensions needed for this TextField.

Overrides:
getMinimumSize in class TextField
 o getPreferredSize
 public Dimension getPreferredSize()
Returns the preferred size Dimensions needed for this TextField.

Overrides:
getPreferredSize in class TextField
 o getPrefixString
 public String getPrefixString()
Gets the prefixStringproperty (java.lang.String) value. The prefixString appears at the begining of the TextField at all times, and is returned with the getTextAsString() method.

Returns:
The prefixString property value.
See Also:
setPrefixString
 o getSuffixString
 public String getSuffixString()
Gets the suffixStringproperty (java.lang.String) value. The suffixString appears at the end of the TextField at all times, and is returned with the getTextAsString() method.

Returns:
The suffixString property value.
See Also:
setSuffixString
 o getTextAsString
 public String getTextAsString()
Returns the String value of what is currently in the TextField. If the TextField only contains its prefixString and suffixString values this method will return an empty String, otherwise it will return the same String as getText().

Returns:
java.lang.String
 o handleException
 private void handleException(Throwable exception)
Called whenever the part throws an exception.

Parameters:
exception - java.lang.Throwable
 o initConnections
 private void initConnections()
Initializes connections

 o initialize
 private void initialize()
Initialize the class.

 o removePropertyChangeListener
 public synchronized void removePropertyChangeListener(PropertyChangeListener listener)
The removePropertyChangeListener method was generated to support the propertyChange field.

Parameters:
listener - java.beans.PropertyChangeListener
 o repaint
 private void repaint(String oldString,
                      String newString)
This method determines if the TextField is currently displaying a valid value. If it is not, the new value is set and the Text Field is repainted -- otherwise no repaint() is performed.

Parameters:
oldString - java.lang.String
newString - java.lang.String
 o setCaretPosition
 public void setCaretPosition(int position)
Sets the position of the text insertion caret for the TextComponent

Parameters:
position - the position
Throws: IllegalArgumentException
If position is less than 0.
Overrides:
setCaretPosition in class TextComponent
 o setInputAsLong
 private void setInputAsLong(Long newValue)
Set the InputAsLong to a new value.

Parameters:
newValue - java.lang.Long
 o setPrefixString
 public void setPrefixString(String prefixString)
Sets the prefixString property (java.lang.String) value. The prefixString appears at the begining of the TextField at all times, and is returned with the getTextAsString() method.

Parameters:
prefixString - The new value for the property.
See Also:
getPrefixString
 o setSuffixString
 public void setSuffixString(String suffixString)
Sets the suffixString property (java.lang.String) value. The suffixString appears at the end of the TextField at all times, and is returned with the getTextAsString() method.

Parameters:
suffixString - The new value for the property.
See Also:
getSuffixString
 o textValueChanged
 public void textValueChanged(TextEvent e)
Method to handle events for the TextListener interface.

Parameters:
e - java.awt.event.TextEvent
 o typeSensitiveTextValueEnforcer
 private void typeSensitiveTextValueEnforcer(String aString)
This method ensures that the value entered by the user into the TextField conforms to the range of a Java primitive long.

Parameters:
aString - java.lang.String

All Packages  Class Hierarchy  This Package  Previous  Next  Index