net.sf.doolin.gui.field.list
Class FieldRadioGroup<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>
                  extended by net.sf.doolin.gui.field.list.FieldRadioGroup<V,E>
Type Parameters:
V - Type of object for the view
E - Type of object in the item list
All Implemented Interfaces:
Serializable, IBean, FieldDescriptor<V>

public class FieldRadioGroup<V,E>
extends AbstractListPropertyFieldDescriptor<V,E>

Field descriptor for a group of radio buttons.

Author:
Damien Coraboeuf
See Also:
Serialized Form

Field Summary
static String BUTTON_GROUP
          Field property for the button group
 
Constructor Summary
FieldRadioGroup()
           
 
Method Summary
protected  JRadioButton buildRadio(GUIView<V> view, SimpleField<V> field, E item)
          Creates a radio button for a given value.
protected  void buildRadioList(GUIView<V> view, SimpleField<V> field, JPanel container)
          Creates the radio button list
 Field<V> createField(GUIView<V> view)
          Creates a field.
 int getOrientation()
           
 String getSpace()
          Gets the layout space between the buttons.
 void setDisplayState(Field<V> field, JComponent component, DisplayState displayState)
          Sets the display state of the field
 void setOrientation(int orientation)
          Sets the orientation of the buttons in the group.
 void setSpace(String space)
          Sets the layout space between the buttons.
 
Methods inherited from class net.sf.doolin.gui.field.list.AbstractListPropertyFieldDescriptor
createListWithNull, getActualCellRenderer, getInitialListValueModel, getItemListFactory, getLabelInfoProvider, getListModel, getRenderer, isItemListAddNull, setItemListAddNull, setItemListFactory, setLabelInfoProvider, setRenderer
 
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, 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
 

Field Detail

BUTTON_GROUP

public static final String BUTTON_GROUP
Field property for the button group

See Also:
PropertyContainer.getProperty(Object), Constant Field Values
Constructor Detail

FieldRadioGroup

public FieldRadioGroup()
Method Detail

buildRadio

protected JRadioButton buildRadio(GUIView<V> view,
                                  SimpleField<V> field,
                                  E item)
Creates a radio button for a given value.

Parameters:
view - Hosting view
field - Field for the group
item - Item to associate the radio button with
Returns:
Radio button

buildRadioList

protected void buildRadioList(GUIView<V> view,
                              SimpleField<V> field,
                              JPanel container)
Creates the radio button list

Parameters:
view - Hosting view
field - Field for the group
container - Panel that must contain the radio buttons

createField

public Field<V> createField(GUIView<V> view)
Creates a field.

Parameters:
view - Owning view
Returns:
Created field

getOrientation

public int getOrientation()

getSpace

public String getSpace()
Gets the layout space between the buttons.

Returns:
Layout space

setDisplayState

public void setDisplayState(Field<V> field,
                            JComponent component,
                            DisplayState displayState)
Description copied from interface: FieldDescriptor
Sets the display state of the field

Specified by:
setDisplayState in interface FieldDescriptor<V>
Overrides:
setDisplayState in class AbstractFieldDescriptor<V>
Parameters:
field - Field
component - Decorated field component

setOrientation

public void setOrientation(int orientation)
Sets the orientation of the buttons in the group. It is either SwingConstants.VERTICAL (the default) or SwingConstants.HORIZONTAL.


setSpace

public void setSpace(String space)
Sets the layout space between the buttons. It is set by default to "0dlu".

Parameters:
space - Layout space


Copyright © 2011. All Rights Reserved.