net.sf.doolin.gui.field.list
Class AbstractListPropertyFieldDescriptor<V,E>

java.lang.Object
  extended by net.sf.doolin.bus.bean.Bean
      extended by net.sf.doolin.gui.field.AbstractFieldDescriptor<V>
          extended by net.sf.doolin.gui.field.AbstractPropertyFieldDescriptor<V>
              extended by net.sf.doolin.gui.field.list.AbstractListPropertyFieldDescriptor<V,E>
Type Parameters:
V - Type of object for the view
E - Type of object for the list
All Implemented Interfaces:
Serializable, IBean, FieldDescriptor<V>
Direct Known Subclasses:
FieldCombo, FieldMultiCombo, FieldRadioGroup

public abstract class AbstractListPropertyFieldDescriptor<V,E>
extends AbstractPropertyFieldDescriptor<V>

Abstract field descriptor for fields that are based on a list of objects.

Author:
Damien Coraboeuf
See Also:
Serialized Form

Constructor Summary
AbstractListPropertyFieldDescriptor()
           
 
Method Summary
protected  ca.odell.glazedlists.CompositeList<E> createListWithNull(ca.odell.glazedlists.EventList<E> sourceList)
          Creates the list with null.
protected  ListCellRenderer getActualCellRenderer()
          Gets the actual cell renderer to use.
protected  ca.odell.glazedlists.EventList<E> getInitialListValueModel(GUIView<V> view)
          Gets the initial list value model.
 DataFactory<ca.odell.glazedlists.EventList<E>> getItemListFactory()
          Gets the item list factory.
 LabelInfoProvider getLabelInfoProvider()
          Gets the LabelInfoProvider used to render the cell.
protected  ca.odell.glazedlists.EventList<E> getListModel(GUIView<V> view)
          Gets the list model.
 ListCellRenderer getRenderer()
          Gets the cell renderer for the list
 boolean isItemListAddNull()
          Checks if a null entry is added at the beginning of the list.
 void setItemListAddNull(boolean itemListAddNull)
          Sets if a null entry is added at the beginning of the list
 void setItemListFactory(DataFactory<ca.odell.glazedlists.EventList<E>> itemListFactory)
          Sets the item list factory.
 void setLabelInfoProvider(LabelInfoProvider labelInfoProvider)
          Sets the LabelInfoProvider used to render the cell.
 void setRenderer(ListCellRenderer renderer)
          Sets the cell renderer for the list
 
Methods inherited from class net.sf.doolin.gui.field.AbstractPropertyFieldDescriptor
getAdapter, getProperty, getPropertyPath, setAdapter, setProperty, setPropertyPath, subscribe, subscribe
 
Methods inherited from class net.sf.doolin.gui.field.AbstractFieldDescriptor
getActionFactory, getConstraint, getDisplayStateHandler, getIconService, getName, getStyle, getTransferHandler, onInit, onShow, setActionFactory, setConstraint, setDisplayState, setDisplayStateHandler, setIconService, setName, setStyle, setTransferHandler
 
Methods inherited from class net.sf.doolin.bus.bean.Bean
getBeanNotificationSupport, getParentBean, notify, setParentBean
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.doolin.gui.field.FieldDescriptor
createField
 

Constructor Detail

AbstractListPropertyFieldDescriptor

public AbstractListPropertyFieldDescriptor()
Method Detail

getListModel

protected ca.odell.glazedlists.EventList<E> getListModel(GUIView<V> view)
Gets the list model.

Parameters:
view - the view
Returns:
the list model

getInitialListValueModel

protected ca.odell.glazedlists.EventList<E> getInitialListValueModel(GUIView<V> view)
Gets the initial list value model.

Parameters:
view - the view
Returns:
the initial list value model

createListWithNull

protected ca.odell.glazedlists.CompositeList<E> createListWithNull(ca.odell.glazedlists.EventList<E> sourceList)
Creates the list with null.

Parameters:
sourceList - the source list
Returns:
the composite list< object>

isItemListAddNull

public boolean isItemListAddNull()
Checks if a null entry is added at the beginning of the list.

Returns:
true if a null entry is added at the beginning of the list

setItemListAddNull

public void setItemListAddNull(boolean itemListAddNull)
Sets if a null entry is added at the beginning of the list

Parameters:
itemListAddNull - true if a null entry is added at the beginning of the list

getItemListFactory

public DataFactory<ca.odell.glazedlists.EventList<E>> getItemListFactory()
Gets the item list factory.

Returns:
the item list factory

setItemListFactory

public void setItemListFactory(DataFactory<ca.odell.glazedlists.EventList<E>> itemListFactory)
Sets the item list factory.

Parameters:
itemListFactory - the new item list factory

getRenderer

public ListCellRenderer getRenderer()
Gets the cell renderer for the list

Returns:
Renderer

setRenderer

public void setRenderer(ListCellRenderer renderer)
Sets the cell renderer for the list

Parameters:
renderer - Renderer

getLabelInfoProvider

public LabelInfoProvider getLabelInfoProvider()
Gets the LabelInfoProvider used to render the cell. If the renderer is defined, this property is ignored

Returns:
Label info provider

setLabelInfoProvider

public void setLabelInfoProvider(LabelInfoProvider labelInfoProvider)
Sets the LabelInfoProvider used to render the cell. It is set by default to DefaultLabelInfoProvider.

Parameters:
labelInfoProvider - Label info provider
See Also:
getLabelInfoProvider()

getActualCellRenderer

protected ListCellRenderer getActualCellRenderer()
Gets the actual cell renderer to use.

If the renderer is set, it is used.

If the labelInfoProvider is set, a LabelInfoListCellRenderer is created and used.

Otherwise, a DefaultListCellRenderer is used.

Returns:
A list cell renderer


Copyright © 2011. All Rights Reserved.