org.jdesktop.swing.binding
Interface Binding

All Known Implementing Classes:
AbstractBinding

public interface Binding

Class which binds a user-interface component to a specific element in a data model. A Binding instance implements the following tasks:


Field Summary
static int AUTO_VALIDATE
           
static int AUTO_VALIDATE_NONE
           
static int AUTO_VALIDATE_STRICT
           
static int INVALID
           
static int UNVALIDATED
           
static int VALID
           
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener pcl)
           
 JComponent getComponent()
           
 DataModel getDataModel()
           
 String getFieldName()
           
 PropertyChangeListener[] getPropertyChangeListeners()
           
 String[] getValidationErrors()
          Returns validation error messages generated from the most recent element-level validation pass.
 int getValidState()
           
 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(PropertyChangeListener pcl)
           
 

Field Detail

AUTO_VALIDATE

public static final int AUTO_VALIDATE
See Also:
Constant Field Values

AUTO_VALIDATE_STRICT

public static final int AUTO_VALIDATE_STRICT
See Also:
Constant Field Values

AUTO_VALIDATE_NONE

public static final int AUTO_VALIDATE_NONE
See Also:
Constant Field Values

UNVALIDATED

public static final int UNVALIDATED
See Also:
Constant Field Values

VALID

public static final int VALID
See Also:
Constant Field Values

INVALID

public static final int INVALID
See Also:
Constant Field Values
Method Detail

getComponent

public JComponent getComponent()

getDataModel

public DataModel getDataModel()

getFieldName

public String getFieldName()

pull

public boolean pull()
Pulls the value of this binding's data model element into its UI component.

Returns:
boolean indicating whether or not the value was pulled from the data model

isModified

public boolean isModified()
Returns:
boolean indicating whether or not the value contained in this binding's UI component has been modified since the value was last pushed or pulled

isValid

public boolean isValid()
Returns:
boolean indicating whether or not the value contained in this binding's UI component is valid

getValidState

public int getValidState()

getValidationErrors

public String[] getValidationErrors()
Returns validation error messages generated from the most recent element-level validation pass.

Returns:
array containing any error messages which occurred during element-level validation

push

public boolean push()
Pushes the current value contained in this binding's UI component to this binding's data model element. Only valid values should be pushed to the model.

Returns:
boolean indicating whether or not the value was pushed to the data model

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener pcl)

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener pcl)

getPropertyChangeListeners

public PropertyChangeListener[] getPropertyChangeListeners()


Copyright 2004 by Sun Microsystems, Inc. All Rights Reserved.