|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.binding.swingx.AbstractBinding
public abstract class AbstractBinding
Abstract base class which implements a default mechanism for binding user-interface components to elements in a data model. Note:
Field Summary | |
---|---|
protected java.lang.Object |
cachedValue
|
protected DataModel |
dataModel
|
protected java.util.ArrayList |
errorList
|
protected java.lang.String |
fieldName
|
protected MetaData |
metaData
|
protected boolean |
modified
|
protected boolean |
pulling
|
protected boolean |
pushing
|
protected int |
validState
|
Fields inherited from interface org.jdesktop.binding.swingx.Binding |
---|
AUTO_VALIDATE, AUTO_VALIDATE_NONE, AUTO_VALIDATE_STRICT, INVALID, UNVALIDATED, VALID |
Constructor Summary | |
---|---|
protected |
AbstractBinding(javax.swing.JComponent component,
DataModel dataModel,
java.lang.String fieldName,
int validationPolicy)
|
Method Summary | |
---|---|
protected void |
addError(java.lang.String error)
|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener pcl)
Adds the specified property change listener to this binding object. |
protected void |
checkNull(java.lang.Object component,
java.lang.String message)
|
protected boolean |
checkRequired(java.lang.Object componentValue)
|
void |
clearValidationErrors()
|
protected java.lang.String |
convertFromModelType(java.lang.Object modelValue)
|
protected java.lang.Object |
convertToModelType(java.lang.Object componentValue)
|
protected boolean |
executeValidators(java.lang.Object value)
|
protected void |
firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
|
protected abstract java.lang.Object |
getComponentValue()
|
DataModel |
getDataModel()
|
java.lang.String |
getFieldName()
|
java.beans.PropertyChangeListener[] |
getPropertyChangeListeners()
|
java.lang.String[] |
getValidationErrors()
Returns validation error messages generated from the most recent element-level validation pass. |
int |
getValidationPolicy()
|
int |
getValidState()
|
protected void |
installDataModel(DataModel dataModel,
java.lang.String fieldName)
|
protected void |
installDataModelListener()
|
protected void |
installInputVerifier()
installs an InputVerifier depending on validationPolicy. |
protected void |
installMetaDataListener()
here: does nothing |
protected boolean |
isEmpty(java.lang.Object componentValue)
|
boolean |
isModified()
|
boolean |
isValid()
|
boolean |
pull()
Pulls the value of this binding's data model element into its UI component. |
boolean |
push()
Pushes the current value contained in this binding's UI component to this binding's data model element. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener pcl)
Removes the specified property change listener from this binding object. |
protected abstract void |
setComponent(javax.swing.JComponent component)
set component and configures metaData dependent logic/constraint state. |
protected abstract void |
setComponentValue(java.lang.Object value)
|
protected void |
setModified(boolean modified)
|
void |
setValidationPolicy(int policy)
|
protected void |
setValidState(int validState)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jdesktop.binding.swingx.Binding |
---|
getComponent |
Field Detail |
---|
protected DataModel dataModel
protected MetaData metaData
protected java.lang.String fieldName
protected java.lang.Object cachedValue
protected java.util.ArrayList errorList
protected boolean modified
protected int validState
protected boolean pulling
protected boolean pushing
Constructor Detail |
---|
protected AbstractBinding(javax.swing.JComponent component, DataModel dataModel, java.lang.String fieldName, int validationPolicy)
component
- dataModel
- fieldName
- validationPolicy
-
java.lang.NullPointerException
- if component, dataModel or
fieldName is nullMethod Detail |
---|
public DataModel getDataModel()
getDataModel
in interface Binding
public java.lang.String getFieldName()
getFieldName
in interface Binding
public void setValidationPolicy(int policy)
policy
- public int getValidationPolicy()
public boolean pull()
Binding
pull
in interface Binding
public boolean push()
Binding
push
in interface Binding
public boolean isModified()
isModified
in interface Binding
public boolean isValid()
isValid
in interface Binding
public int getValidState()
getValidState
in interface Binding
public java.lang.String[] getValidationErrors()
Binding
getValidationErrors
in interface Binding
public void clearValidationErrors()
public void addPropertyChangeListener(java.beans.PropertyChangeListener pcl)
addPropertyChangeListener
in interface Binding
pcl
- PropertyChangeListener object to receive events when binding
properties changepublic void removePropertyChangeListener(java.beans.PropertyChangeListener pcl)
removePropertyChangeListener
in interface Binding
pcl
- PropertyChangeListener object to receive events when binding
properties changepublic java.beans.PropertyChangeListener[] getPropertyChangeListeners()
getPropertyChangeListeners
in interface Binding
protected void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
protected abstract void setComponent(javax.swing.JComponent component)
component
- protected abstract java.lang.Object getComponentValue()
protected abstract void setComponentValue(java.lang.Object value)
protected boolean checkRequired(java.lang.Object componentValue)
protected boolean isEmpty(java.lang.Object componentValue)
protected java.lang.Object convertToModelType(java.lang.Object componentValue) throws ConversionException
ConversionException
protected java.lang.String convertFromModelType(java.lang.Object modelValue)
protected boolean executeValidators(java.lang.Object value)
protected void addError(java.lang.String error)
protected void setModified(boolean modified)
protected void setValidState(int validState)
protected void installInputVerifier()
protected void checkNull(java.lang.Object component, java.lang.String message)
protected void installDataModel(DataModel dataModel, java.lang.String fieldName)
protected void installDataModelListener()
protected void installMetaDataListener()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |