wt.clients.beans.selectors
Interface ComponentDelegate

All Known Implementing Classes:
ComponentDelegateAdapter

public interface ComponentDelegate

This is the interface defining what a ComponentDelegate used by the wt.clients.beans.AttributesForm must implement.

Supported API: true

Extendable: true


Method Summary
 void addObjectPropertyChangeListener(PropertyChangeListener listener)
          Add a property change listener which should be notified when the attribute value changes in the component.
 Component getComponent()
          Return the component to be used.
 Dimension getComponentPreferredGridSize()
          Return the preferred grid size of the component.
 Object getObject()
           
 Object getValue()
          Return the current value for the attribute as contained in the component used to display the attribute value.
 boolean hasOwnLabel()
          Returns true if the component supplies its own label and one should not be created for it by the AttributesForm.
 boolean isDirect()
          Return true if the ComponentDelegate works directly with the object containing the attribute, instead of with the individual attribute.
 boolean isDirty()
          Return true if the value of the attribute has been modified in user interface.
 void removeObjectPropertyChangeListener(PropertyChangeListener listener)
          Remove a property change listener.
 void setComponentContext(ComponentContext context)
          Set the context for the component.
 void setObject(Object object)
           
 void setPropertyDescriptor(PropertyDescriptor descriptor)
          Sets the property descriptor for the attribute.
 void setValue(Object value)
          Sets the current value for the attribute.
 

Method Detail

getComponent

public Component getComponent()
Return the component to be used. The delegate is responsible for creating a component appropriate for the datatype and context.

Returns:
Component

isDirect

public boolean isDirect()
Return true if the ComponentDelegate works directly with the object containing the attribute, instead of with the individual attribute. If this method returns true, the setObject() and getObject() methods should be invoked instead of the getValue() and setValue() methods.

Returns:
boolean

isDirty

public boolean isDirty()
Return true if the value of the attribute has been modified in user interface.

Returns:
boolean

getValue

public Object getValue()
                throws WTException,
                       WTPropertyVetoException
Return the current value for the attribute as contained in the component used to display the attribute value.

Returns:
Object
Throws:
WTException
WTPropertyVetoException

setValue

public void setValue(Object value)
              throws WTException
Sets the current value for the attribute.

Parameters:
value -
Throws:
WTException

getObject

public Object getObject()
                 throws WTException
Returns:
Object
Throws:
WTException

setObject

public void setObject(Object object)
               throws WTException
Parameters:
object -
Throws:
WTException

setPropertyDescriptor

public void setPropertyDescriptor(PropertyDescriptor descriptor)
Sets the property descriptor for the attribute. This contains information about the minimum and maximum lengths, whether the attribute is required, etc.

Parameters:
descriptor -

setComponentContext

public void setComponentContext(ComponentContext context)
Set the context for the component. This contains information about the mode ( UPDATE_MODE, VIEW_MODE, or CREATE_MODE).

Parameters:
context -

hasOwnLabel

public boolean hasOwnLabel()
Returns true if the component supplies its own label and one should not be created for it by the AttributesForm.

Returns:
boolean

getComponentPreferredGridSize

public Dimension getComponentPreferredGridSize()
Return the preferred grid size of the component. The default value is (1,1) which gives it a grid width and height of 1 in the AttributesForm. To take up two grid positions horizontally, return a preferred grid size of (2,1).

Returns:
Dimension

addObjectPropertyChangeListener

public void addObjectPropertyChangeListener(PropertyChangeListener listener)
Add a property change listener which should be notified when the attribute value changes in the component.

Parameters:
listener -

removeObjectPropertyChangeListener

public void removeObjectPropertyChangeListener(PropertyChangeListener listener)
Remove a property change listener.

Parameters:
listener -