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.
-
fieldPrefixString
-
-
fieldSuffixString
-
-
ivjInputAsLong
-
-
javaVendor
-
-
propertyChange
-
-
BSIntegerTextField()
- Constructor
-
BSIntegerTextField(int)
- BSIntegerTextField constructor comment.
-
BSIntegerTextField(String)
- BSIntegerTextField constructor comment.
-
BSIntegerTextField(String, int)
- BSIntegerTextField constructor comment.
-
addPropertyChangeListener(PropertyChangeListener)
- The addPropertyChangeListener method was generated to support the propertyChange field.
-
conn1(TextEvent)
- conn1
-
conn4(FocusEvent)
- conn4
-
firePropertyChange(String, Object, Object)
- The firePropertyChange method was generated to support the propertyChange field.
-
focusGained(FocusEvent)
- Method to handle events for the FocusListener interface.
-
focusLost(FocusEvent)
- Method to handle events for the FocusListener interface.
-
getInputAs_long()
- This method will return the Java primitive long value of the
text presently in the TextField.
-
getInputAsLong()
- Return the InputAsLong property value, the Long representation of the text
currently in the TextField.
-
getMinimumSize()
- Returns the minimum size Dimensions needed for this TextField.
-
getPreferredSize()
- Returns the preferred size Dimensions needed for this TextField.
-
getPrefixString()
- Gets the prefixStringproperty (java.lang.String) value.
-
getSuffixString()
- Gets the suffixStringproperty (java.lang.String) value.
-
getTextAsString()
- Returns the String value of what is currently in the TextField.
-
handleException(Throwable)
- Called whenever the part throws an exception.
-
initConnections()
- Initializes connections
-
initialize()
- Initialize the class.
-
removePropertyChangeListener(PropertyChangeListener)
- The removePropertyChangeListener method was generated to support the propertyChange field.
-
repaint(String, String)
- This method determines if the TextField is currently displaying
a valid value.
-
setCaretPosition(int)
- Sets the position of the text insertion caret for the TextComponent
-
setInputAsLong(Long)
- Set the InputAsLong to a new value.
-
setPrefixString(String)
- Sets the prefixString property (java.lang.String) value.
-
setSuffixString(String)
- Sets the suffixString property (java.lang.String) value.
-
textValueChanged(TextEvent)
- Method to handle events for the TextListener interface.
-
typeSensitiveTextValueEnforcer(String)
- This method ensures that the value entered by the user into the
TextField conforms to the range of a Java primitive long.
fieldPrefixString
protected String fieldPrefixString
fieldSuffixString
protected String fieldSuffixString
ivjInputAsLong
private Long ivjInputAsLong
javaVendor
protected String javaVendor
propertyChange
protected transient PropertyChangeSupport propertyChange
BSIntegerTextField
public BSIntegerTextField()
- Constructor
BSIntegerTextField
public BSIntegerTextField(int columns)
- BSIntegerTextField constructor comment.
- Parameters:
- columns - int
BSIntegerTextField
public BSIntegerTextField(String text)
- BSIntegerTextField constructor comment.
- Parameters:
- text - java.lang.String
BSIntegerTextField
public BSIntegerTextField(String text,
int columns)
- BSIntegerTextField constructor comment.
- Parameters:
- text - java.lang.String
- columns - int
addPropertyChangeListener
public synchronized void addPropertyChangeListener(PropertyChangeListener listener)
- The addPropertyChangeListener method was generated to support the propertyChange field.
- Parameters:
- listener - java.beans.PropertyChangeListener
conn1
private void conn1(TextEvent arg1)
- conn1
- Parameters:
- arg1 - java.awt.event.TextEvent
conn4
private void conn4(FocusEvent arg1)
- conn4
- Parameters:
- arg1 - java.awt.event.FocusEvent
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
focusGained
public void focusGained(FocusEvent e)
- Method to handle events for the FocusListener interface.
- Parameters:
- e - java.awt.event.FocusEvent
focusLost
public void focusLost(FocusEvent e)
- Method to handle events for the FocusListener interface.
- Parameters:
- e - java.awt.event.FocusEvent
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
getInputAsLong
public Long getInputAsLong()
- Return the InputAsLong property value, the Long representation of the text
currently in the TextField.
- Returns:
- java.lang.Long
getMinimumSize
public Dimension getMinimumSize()
- Returns the minimum size Dimensions needed for this TextField.
- Overrides:
- getMinimumSize in class TextField
getPreferredSize
public Dimension getPreferredSize()
- Returns the preferred size Dimensions needed for this TextField.
- Overrides:
- getPreferredSize in class TextField
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
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
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
handleException
private void handleException(Throwable exception)
- Called whenever the part throws an exception.
- Parameters:
- exception - java.lang.Throwable
initConnections
private void initConnections()
- Initializes connections
initialize
private void initialize()
- Initialize the class.
removePropertyChangeListener
public synchronized void removePropertyChangeListener(PropertyChangeListener listener)
- The removePropertyChangeListener method was generated to support the propertyChange field.
- Parameters:
- listener - java.beans.PropertyChangeListener
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
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
setInputAsLong
private void setInputAsLong(Long newValue)
- Set the InputAsLong to a new value.
- Parameters:
- newValue - java.lang.Long
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
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
textValueChanged
public void textValueChanged(TextEvent e)
- Method to handle events for the TextListener interface.
- Parameters:
- e - java.awt.event.TextEvent
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