de.kleopatra.view.binding
Class BindingMetaData

java.lang.Object
  extended byde.kleopatra.view.binding.BindingMetaData
Direct Known Subclasses:
ComboBoxBindingMetaData, FormattedTextBindingMetaData, ListBindingMetaData, RadioBindingMetaData, SpinnerBindingMetaData, TextBindingMetaData

public class BindingMetaData
extends java.lang.Object

Dump for MetaData required to bind a property to a widget.

Typically the MetaData is filled by client code (f.i. the BeanBinding), given to a BindingMap to find an appropriate BindingHandler which in turn is responsible to actually wire the the property to a component.

It's up to the BindingMap to decide which handlers to choose. It may use the XXMetaData.class as well as the metaData properties componentClass or targetClass.

All setters are meant to be used during the filling phase only

NOTE: as all binding api this still has a high probability of change.

Version:
$Revision: 1.5 $ - $Date: 2004/10/01 12:27:06 $
Author:
(C) 2004 Jeanette Winzenburg, Berlin

Field Summary
protected  boolean commitOnFocusLost
           
protected  java.lang.Class componentClass
           
protected  java.lang.String componentName
           
protected  Trigger focusLostTrigger
           
protected  java.lang.String propertyName
           
protected  java.lang.Class targetClass
           
 
Constructor Summary
BindingMetaData(java.lang.String componentName)
          PRE: componentName !
BindingMetaData(java.lang.String componentName, java.lang.Class componentClass)
           
BindingMetaData(java.lang.String componentName, java.lang.String propertyName)
           
BindingMetaData(java.lang.String componentName, java.lang.String propertyName, java.lang.Class componentClass)
           
 
Method Summary
 java.lang.Class getComponentClass()
          returns the Class of the binding component.
 java.lang.String getComponentName()
          returns the name of the component to bind to.
 Trigger getFocusLostTrigger()
           
 java.lang.String getPropertyName()
          returns the name of the property to be bound.
 java.lang.Class getTargetClass()
          returns the class of the bound property.
protected  void initDefaultCommit()
          hook for subclasses to control default commit behaviour.
 boolean isCommitOnFocusLost()
          returns true if committing the component value to the property should be delayed until a focusLost event.
 void setCommitOnFocusLost(boolean commitOnFocusLost)
           
 void setComponentClass(java.lang.Class componentClass)
           
 void setComponentName(java.lang.String componentName)
           
 void setFocusLostTrigger(Trigger focusLostTrigger)
          sets the trigger to use on commitOnFocusLost.
 void setPropertyName(java.lang.String propertyName)
          set the name of the property to be bound.
 void setTargetClass(java.lang.Class targetClass)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

componentName

protected java.lang.String componentName

propertyName

protected java.lang.String propertyName

targetClass

protected java.lang.Class targetClass

componentClass

protected java.lang.Class componentClass

commitOnFocusLost

protected boolean commitOnFocusLost

focusLostTrigger

protected Trigger focusLostTrigger
Constructor Detail

BindingMetaData

public BindingMetaData(java.lang.String componentName)
PRE: componentName != null.

Parameters:
componentName -

BindingMetaData

public BindingMetaData(java.lang.String componentName,
                       java.lang.String propertyName)

BindingMetaData

public BindingMetaData(java.lang.String componentName,
                       java.lang.Class componentClass)

BindingMetaData

public BindingMetaData(java.lang.String componentName,
                       java.lang.String propertyName,
                       java.lang.Class componentClass)
Method Detail

getComponentName

public java.lang.String getComponentName()
returns the name of the component to bind to.

Returns:

setComponentName

public void setComponentName(java.lang.String componentName)

getPropertyName

public java.lang.String getPropertyName()
returns the name of the property to be bound.

Returns:
the propertyName if explicitly set or the componentName if propertyName is null.

setPropertyName

public void setPropertyName(java.lang.String propertyName)
set the name of the property to be bound.

Parameters:
propertyName - - can be null which implies propertyName == componentName.

getTargetClass

public java.lang.Class getTargetClass()
returns the class of the bound property.

Returns:

setTargetClass

public void setTargetClass(java.lang.Class targetClass)

getComponentClass

public java.lang.Class getComponentClass()
returns the Class of the binding component.

Returns:

setComponentClass

public void setComponentClass(java.lang.Class componentClass)

getFocusLostTrigger

public Trigger getFocusLostTrigger()

setFocusLostTrigger

public void setFocusLostTrigger(Trigger focusLostTrigger)
sets the trigger to use on commitOnFocusLost.

side-effect: sets the commitOnFocusLost-property to trigger != null.

Parameters:
focusLostTrigger -

isCommitOnFocusLost

public boolean isCommitOnFocusLost()
returns true if committing the component value to the property should be delayed until a focusLost event.

defaults to false.

Returns:

setCommitOnFocusLost

public void setCommitOnFocusLost(boolean commitOnFocusLost)

initDefaultCommit

protected void initDefaultCommit()
hook for subclasses to control default commit behaviour. here: does nothing.



Copyright © 2003, 2004 SwingEmpire Jeanette Winzenburg. All Rights Reserved.