|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.klg.jclass.field.Field
Note that this class is not a part of the public API and is public as a side-effect of the implementation.
This is the "glue" class for JClass Field. It takes events from the Swing visual components and passes this information on to the generic "validator" that is set on the field. For clarity we note here that JClass Field "Validators" are actually "validators/formatters/parsers" Also that this class controls the posting of the Validation and Field events.
Nested Class Summary | |
class |
Field.TextFieldContent
|
Field Summary | |
protected boolean |
allow_text_change
|
static int |
AS_IS
|
protected boolean |
auto_complete_mode
|
protected boolean |
beepOnInvalid
|
static int |
CLEAR_FIELD
|
protected Locale |
current
|
protected boolean |
doing_commit
|
protected boolean |
doing_completion
|
protected Class |
edit_class
|
protected Object |
edit_initial_value
|
protected boolean |
has_focus
|
protected boolean |
in_contents_change
|
protected boolean |
in_set_selected_item
|
protected boolean |
internal_text_change
|
protected boolean |
internalBackgroundChange
|
protected boolean |
internalForegroundChange
|
static int |
INVALID
|
protected Color |
invalidBackground
|
protected Color |
invalidForeground
|
protected int |
invalidPolicy
|
protected boolean |
is_cell_editor
|
static int |
LOWERCASE
|
protected boolean |
okayToBeep
|
static int |
RESTORE_DEFAULT
|
static int |
RESTORE_PREVIOUS
|
protected boolean |
restoringPrevious
|
protected boolean |
select_all
|
protected boolean |
select_on_enter
|
protected boolean |
set_selected_item_called
|
static int |
SHOW_INVALID
|
protected int |
state
|
static int |
UNDEREDIT
|
protected boolean |
upDownPressed
|
static int |
UPPERCASE
|
static int |
VALID
|
protected com.klg.jclass.field.validate.JCValidator |
validator
|
protected Color |
validBackground
|
protected Color |
validForeground
|
protected com.klg.jclass.util.value.JCValueModel |
valueModel
|
protected Component |
vc
|
Constructor Summary | |
Field(Component vc,
com.klg.jclass.field.validate.JCValidator validator)
|
Method Summary | |
void |
addListDataListener(ListDataListener l)
|
void |
addNotify()
This should be called by the "vc" to inform the component that it has been added. |
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener to the listener list. |
void |
addValueListener(com.klg.jclass.util.value.JCValueListener listener)
Adds a listener for changes to the value. |
protected void |
calcAutoCompleteMode(com.klg.jclass.field.JCComboField combo)
Calculate auto_complete_mode value. |
void |
commitEdit()
Commits the current field under edit. |
void |
commitEdit(AWTEvent e)
Commits the current field under edit. |
protected void |
doCommitEdit(AWTEvent e)
Commits the current field under edit. |
protected void |
fireContentsChanged(Object source,
int index0,
int index1)
Called when the combo box's item list changes (which happens when the picklist changes). |
protected void |
fireValueChangedEvent(com.klg.jclass.util.value.JCValueEvent event)
Fires a valueChanged event to the JCValuelisteners. |
protected void |
fireValueChangingEvent(com.klg.jclass.util.value.JCValueEvent event)
Fires a valueChanging event to the JCValuelisteners. |
boolean |
getAllowTextChange()
Used by the Visual Component to see if a call that has been made to its setText() method is permitted. |
protected boolean |
getBeepOnInvalid()
Returns the value of beepOnInvalid. |
Component |
getComponent()
Returns the visual component currently being used. |
com.klg.jclass.field.DataProperties |
getDataProperties()
Gets the Bean property which wraps the validator, data model, and Field objects properties into one property. |
Object |
getElementAt(int index)
Returns the element at a given index in a pick list. |
Object |
getEventSource()
Returns the Object that is being used as the source of posted events. |
protected Color |
getInvalidBackground()
Returns the background color used in the visual component if the field is invalid. |
protected Color |
getInvalidForeground()
Returns the foreground color used in the visual component if the field is invalid. |
com.klg.jclass.field.JCInvalidInfo |
getInvalidInfo()
Returns the Invalid properties. |
protected int |
getInvalidPolicy()
Returns the value of invalidPolicy. |
Object |
getSelectedItem()
Get the currently selected item (and format accordingly) |
boolean |
getSelectOnEnter()
Returns a flag indicating the selection status on entering the field. |
int |
getSize()
Returns the number of items in the pick list. |
int |
getState()
Returns the state of the field. |
protected JTextField |
getTextField()
Returns a JTextField given a component. |
com.klg.jclass.field.validate.JCValidator |
getValidator()
Returns the current validator being used by this field of the field. |
protected Color |
getValidBackground()
Returns the background color used in the visual component if the field is valid. |
protected Color |
getValidForeground()
Returns the foreground color used in the visual component if the field is valid. |
Object |
getValue()
Returns the internal value of the field. |
com.klg.jclass.util.value.JCValueModel |
getValueModel()
Returns the data model being used by the field. |
Component |
getVisualComponent()
This method is internal. |
protected void |
processFailure()
Called either from after a failed parse or after a failed. |
void |
removeListDataListener(ListDataListener l)
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes a PropertyChangeListener from the listener list. |
void |
removeValueListener(com.klg.jclass.util.value.JCValueListener listener)
Removes a listener for changes to the value. |
protected void |
restorePickList()
Restore the picklist to its original value before AutoRefinement changed it. |
protected void |
setBeepOnInvalid(boolean beep)
Sets the value of beepOnInvalid. |
void |
setCellEditor(boolean isCellEditor)
Sets the is_cell_editor property Default is false |
void |
setClass(Class c)
Sets the internal value of the field. |
protected void |
setColors(Color background,
Color foreground)
Sets the background and foreground of the component. |
void |
setDataProperties(com.klg.jclass.field.DataProperties data_properties)
Sets a Bean property which wraps the validator, data model, and Field objects properties into one property. |
void |
setEventSource(Object o)
Sets the Object that is being used as the source of posted events. |
protected void |
setInvalidBackground(Color background)
Sets the background color used in the visual component if the field is invalid. |
protected void |
setInvalidForeground(Color foreground)
Sets the foreground color used in the visual component if the field is invalid. |
void |
setInvalidInfo(com.klg.jclass.field.JCInvalidInfo info)
Sets the Invalid properties. |
protected void |
setInvalidPolicy(int policy)
Sets the invalid policy. |
void |
setSelectedItem(Object anItem)
Set an item from the picklist on the text field |
void |
setSelectOnEnter(boolean select)
Sets the flag that determines whether of not the Text Component is automatically selected when the component gains focus. |
protected void |
setStateInvalid()
Does everything necessary to make the state invalid, including swapping colors. |
protected void |
setStateUnderEdit()
Does everything necessary to make the state "under edit," including swapping colors. |
protected void |
setStateValid()
Does everything necessary to make the state valid, including swapping colors. |
protected void |
setText(String text_string)
Sets the actual text string of the visual component. |
void |
setValidator(com.klg.jclass.field.validate.JCValidator validator)
Sets the validator being used by the field. |
void |
setValue(Object new_value)
Sets the internal value of the field. |
protected void |
setValue(Object new_value,
boolean exit_on_detecting_equality)
Sets the internal value of the field. |
protected void |
setValueAndReformat(Object new_value)
Sets the internal value of the field. |
void |
setValueModel(com.klg.jclass.util.value.JCValueModel value_model)
Sets the data model being used by the field. |
void |
textCursorMoveBegin(com.klg.jclass.field.validate.TextCursorEvent e)
Invoked before the field's cursor is moved. |
void |
textValueChangeBegin(com.klg.jclass.field.validate.TextEvent e)
Invoked before the field's value is changed. |
void |
textValueChangeEnd(com.klg.jclass.field.validate.TextEvent e)
Invoked after the field's value is changed. |
protected void |
turnOffAutoCompleteMode()
Turn off auto_complete_mode. |
void |
valueChanged(com.klg.jclass.util.value.JCValueEvent event)
The method informs a listener that the value has been changed. |
void |
valueChanging(com.klg.jclass.util.value.JCValueEvent event)
The value is changing. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int VALID
public static final int UNDEREDIT
public static final int INVALID
public static final int SHOW_INVALID
public static final int RESTORE_DEFAULT
public static final int RESTORE_PREVIOUS
public static final int CLEAR_FIELD
public static final int AS_IS
public static final int UPPERCASE
public static final int LOWERCASE
protected boolean internalBackgroundChange
protected boolean internalForegroundChange
protected Color invalidBackground
protected Color invalidForeground
protected Color validBackground
protected Color validForeground
protected boolean select_on_enter
protected Object edit_initial_value
protected Class edit_class
protected com.klg.jclass.field.validate.JCValidator validator
protected Locale current
protected Component vc
protected int state
protected int invalidPolicy
protected boolean beepOnInvalid
protected boolean internal_text_change
protected boolean has_focus
protected boolean auto_complete_mode
protected boolean doing_completion
protected boolean doing_commit
protected boolean in_set_selected_item
protected boolean set_selected_item_called
protected boolean in_contents_change
protected boolean upDownPressed
protected boolean okayToBeep
protected boolean allow_text_change
protected boolean is_cell_editor
protected boolean select_all
protected com.klg.jclass.util.value.JCValueModel valueModel
protected boolean restoringPrevious
Constructor Detail |
public Field(Component vc, com.klg.jclass.field.validate.JCValidator validator)
vc
- visual component used to control input;validator
- validator used to validate "value."Method Detail |
protected JTextField getTextField()
public void addPropertyChangeListener(PropertyChangeListener listener)
listener
- The PropertyChangeListener to be addedpublic void removePropertyChangeListener(PropertyChangeListener listener)
listener
- The PropertyChangeListener to be removedpublic void addValueListener(com.klg.jclass.util.value.JCValueListener listener)
listener
- The ValueListener to be addedpublic void removeValueListener(com.klg.jclass.util.value.JCValueListener listener)
listener
- The ValueListener to be removedpublic void setDataProperties(com.klg.jclass.field.DataProperties data_properties)
public void setCellEditor(boolean isCellEditor)
isCellEditor
- The new value of is_cell_editorpublic com.klg.jclass.field.DataProperties getDataProperties()
public void addNotify()
protected Color getInvalidBackground()
protected void setInvalidBackground(Color background)
Component.setBackground(java.awt.Color)
protected Color getInvalidForeground()
protected void setInvalidForeground(Color foreground)
Component.setForeground(java.awt.Color)
protected Color getValidBackground()
protected Color getValidForeground()
protected boolean getBeepOnInvalid()
setBeepOnInvalid(boolean)
protected void setBeepOnInvalid(boolean beep)
setStateInvalid()
protected int getInvalidPolicy()
setInvalidPolicy(int)
protected void setInvalidPolicy(int policy)
Value | Meaning |
---|---|
SHOW_INVALID | Show invalid value in the invalidBackground and Foreground colors |
RESTORE_DEFAULT | Restore the value to the defaultValue |
RESTORE_PREVIOUS | Restore the value to the previous valid value |
CLEAR_FIELD | Clear the field on invalid input |
public com.klg.jclass.field.JCInvalidInfo getInvalidInfo()
public void setInvalidInfo(com.klg.jclass.field.JCInvalidInfo info)
public int getState()
Value | Meaning |
---|---|
VALID | The field is valid |
INVALID | The field is invalid |
UNDEREDIT | The field is currently under edit and hence the state is indeterminate |
public boolean getSelectOnEnter()
setSelectOnEnter(boolean)
public void setSelectOnEnter(boolean select)
public Object getValue()
protected void setValueAndReformat(Object new_value)
public void setClass(Class c)
public void setValue(Object new_value)
protected void setValue(Object new_value, boolean exit_on_detecting_equality)
public boolean getAllowTextChange()
protected void setText(String text_string)
public com.klg.jclass.util.value.JCValueModel getValueModel()
public void setValueModel(com.klg.jclass.util.value.JCValueModel value_model)
public com.klg.jclass.field.validate.JCValidator getValidator()
public void setValidator(com.klg.jclass.field.validate.JCValidator validator)
protected void setColors(Color background, Color foreground)
background
- if background is null, it will use the default backgroundforeground
- if foreground is null, it will use the initial foregroundprotected void processFailure()
protected void setStateInvalid()
protected void setStateValid()
protected void setStateUnderEdit()
public Component getComponent()
public Object getEventSource()
public void setEventSource(Object o)
public void commitEdit()
public void commitEdit(AWTEvent e)
protected void doCommitEdit(AWTEvent e)
public Component getVisualComponent()
public void textValueChangeBegin(com.klg.jclass.field.validate.TextEvent e)
public void textValueChangeEnd(com.klg.jclass.field.validate.TextEvent e)
public void textCursorMoveBegin(com.klg.jclass.field.validate.TextCursorEvent e)
public int getSize()
getSize
in interface ListModel
public Object getElementAt(int index)
getElementAt
in interface ListModel
public void addListDataListener(ListDataListener l)
addListDataListener
in interface ListModel
public void removeListDataListener(ListDataListener l)
removeListDataListener
in interface ListModel
protected void fireContentsChanged(Object source, int index0, int index1)
source
- The ListModel that changed, typically "this".index0
- One end of the new interval (ignored in this context)index1
- The other end of the new interval (ignored in this context)EventListenerList
,
DefaultListModel
protected void restorePickList()
public void setSelectedItem(Object anItem)
setSelectedItem
in interface ComboBoxModel
public Object getSelectedItem()
getSelectedItem
in interface ComboBoxModel
protected void calcAutoCompleteMode(com.klg.jclass.field.JCComboField combo)
protected void turnOffAutoCompleteMode()
public void valueChanging(com.klg.jclass.util.value.JCValueEvent event)
JCValueListener
new_value
or abort the change altogether. In the case of an
abort (initiatied by calling event.setAllowChange(false)
), the
valueChanged
method will never be called.
valueChanging
in interface JCValueListener
event
- The event generated by the value changingpublic void valueChanged(com.klg.jclass.util.value.JCValueEvent event)
JCValueListener
valueChanged
in interface JCValueListener
event
- The event generated by the value changedprotected void fireValueChangingEvent(com.klg.jclass.util.value.JCValueEvent event)
protected void fireValueChangedEvent(com.klg.jclass.util.value.JCValueEvent event)
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |