org.springframework.richclient.selection.binding.support
Class SelectField

java.lang.Object
  extended by org.springframework.richclient.application.support.ApplicationServicesAccessor
      extended by org.springframework.richclient.factory.AbstractControlFactory
          extended by org.springframework.richclient.selection.binding.support.SelectField
All Implemented Interfaces:
PropertyChangePublisher, ControlFactory
Direct Known Subclasses:
SimpleSelectField

public abstract class SelectField
extends AbstractControlFactory
implements PropertyChangePublisher

SelectField base class. Allows for customization of the renderer component.

A SelectField provides a renderer component (provided by subclasses), a select button and a clear button. The renderer component shows the current value, the select button opens the selection dialog, and the clear button sets the value to null.

Author:
Peter De Bruycker

Field Summary
 
Fields inherited from class org.springframework.richclient.application.support.ApplicationServicesAccessor
logger
 
Constructor Summary
SelectField()
           
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          Register a listener to all properties of this publisher.
 void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
          Register a listener to a specific property.
 void clear()
          Convenience method, calls setValue(null).
protected  JComponent createControl()
          Subclasses must override this method to create a new instance of the control that this factory produces.
protected abstract  JComponent createRenderer()
          Create the component that will do the rendering.
 LabelProvider getLabelProvider()
           
 Object getValue()
           
 boolean isEditable()
           
 void removePropertyChangeListener(PropertyChangeListener listener)
          Remove the listener from all properties of this publisher.
 void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
          Remove the listener from a specific property.
protected abstract  void render(Object value)
          Render the given value.
 void setEditable(boolean editable)
           
 void setEnabled(boolean enabled)
           
 void setLabelProvider(LabelProvider labelProvider)
           
 void setSelectionDialog(ListSelectionDialog dialog)
           
 void setValue(Object value)
           
 
Methods inherited from class org.springframework.richclient.factory.AbstractControlFactory
createControlIfNecessary, getControl, isControlCreated, isSingleton, setSingleton
 
Methods inherited from class org.springframework.richclient.application.support.ApplicationServicesAccessor
getActiveWindow, getApplication, getApplicationContext, getApplicationName, getApplicationServices, getCommandConfigurer, getComponentFactory, getConversionService, getIconSource, getImageSource, getMessage, getMessage, getMessage, getMessage, getMessages, getMessageSource, getObjectConfigurer, getService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectField

public SelectField()
Method Detail

createControl

protected JComponent createControl()
Description copied from class: AbstractControlFactory
Subclasses must override this method to create a new instance of the control that this factory produces.

Specified by:
createControl in class AbstractControlFactory
Returns:
The newly created control, never null.

createRenderer

protected abstract JComponent createRenderer()
Create the component that will do the rendering. Cannot return null.

Returns:
the renderer component

setEnabled

public void setEnabled(boolean enabled)

setEditable

public void setEditable(boolean editable)

isEditable

public boolean isEditable()

setValue

public void setValue(Object value)

clear

public void clear()
Convenience method, calls setValue(null).


render

protected abstract void render(Object value)
Render the given value. Warning: the value can be null.

Parameters:
value - the value

getValue

public Object getValue()

setSelectionDialog

public void setSelectionDialog(ListSelectionDialog dialog)

setLabelProvider

public void setLabelProvider(LabelProvider labelProvider)

getLabelProvider

public LabelProvider getLabelProvider()

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Description copied from interface: PropertyChangePublisher
Register a listener to all properties of this publisher.

Specified by:
addPropertyChangeListener in interface PropertyChangePublisher
Parameters:
listener - the PropertyChangeListener to register.

addPropertyChangeListener

public void addPropertyChangeListener(String propertyName,
                                      PropertyChangeListener listener)
Description copied from interface: PropertyChangePublisher
Register a listener to a specific property.

Specified by:
addPropertyChangeListener in interface PropertyChangePublisher
Parameters:
propertyName - the property to monitor.
listener - the PropertyChangeListener to register.

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Description copied from interface: PropertyChangePublisher
Remove the listener from all properties of this publisher.

Specified by:
removePropertyChangeListener in interface PropertyChangePublisher
Parameters:
listener - the PropertyChangeListener to remove.

removePropertyChangeListener

public void removePropertyChangeListener(String propertyName,
                                         PropertyChangeListener listener)
Description copied from interface: PropertyChangePublisher
Remove the listener from a specific property.

Specified by:
removePropertyChangeListener in interface PropertyChangePublisher
Parameters:
propertyName - the property that was being monitored.
listener - the PropertyChangeListener to remove.


Copyright © 2004-2008 The Spring Framework. All Rights Reserved.